]> Git — Sourcephile - tmp/julm/symantic-reify.git/blob - SemanticEval.hs
add nix files
[tmp/julm/symantic-reify.git] / SemanticEval.hs
1 {-# OPTIONS_GHC -Wno-orphans #-}
2 -- | Semantics for Identity (aka. R, or meta-circular representation).
3 module SemanticEval where
4
5 import Data.Functor.Identity
6 import Syntax
7
8 instance Abstractable Identity where
9 lam f = Identity (runIdentity . f . Identity)
10 (.@) f x = Identity ((runIdentity f) (runIdentity x))
11 {- Defined in Data.Functor.Identity
12 instance Num a => Num (Identity a)
13 instance Fractional a => Fractional (Identity a)
14 -}
15
16 eval :: Identity a -> a
17 eval = runIdentity