doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author paulson
Tue, 28 Nov 2006 16:19:01 +0100
changeset 21573 8a7a68c0096c
parent 21189 5435ccdb4ea1
child 21993 4b802a9e0738
permissions -rw-r--r--
Removed the references for counting combinators. Instead they are counted in actual clauses.

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]