doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Fri, 24 Nov 2006 22:05:18 +0100
changeset 21522 bd641d927437
parent 21189 5435ccdb4ea1
child 21993 4b802a9e0738
permissions -rw-r--r--
added export_morphism; ProofContext.init;

module Codegen where
import qualified Nat

class Null a where
  null :: a

head :: (Codegen.Null a_1) => [a_1] -> a_1
head (y : xs) = y
head [] = Codegen.null

null_option :: Maybe b
null_option = Nothing

instance Codegen.Null (Maybe b) where
  null = Codegen.null_option

dummy :: Maybe Nat.Nat
dummy = Codegen.head [Just (Nat.Suc Nat.Zero_nat), Nothing]