1 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 module Interpreter where
9 newtype Interpreter a = I {runInterpreter :: Maybe a}
10 deriving (Functor, Applicative, Monad)
12 instance Expression Interpreter where
22 not = fmap Prelude.not
29 if' p t e = p >>= \b->if b then t else e
31 instance Function a Interpreter where