doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author haftmann
Fri Apr 20 13:11:47 2007 +0200 (2007-04-20)
changeset 22751 1bfd75c1f232
parent 22188 a63889770d57
child 22798 e3962371f568
permissions -rw-r--r--
updated
     1 module Codegen where {
     2 
     3 import qualified Nat;
     4 
     5 class Null a where {
     6   nulla :: a;
     7 };
     8 
     9 heada :: (Codegen.Null a) => [a] -> a;
    10 heada (x : xs) = x;
    11 heada [] = Codegen.nulla;
    12 
    13 null_option :: Maybe a;
    14 null_option = Nothing;
    15 
    16 instance Codegen.Null (Maybe b) where {
    17   nulla = Codegen.null_option;
    18 };
    19 
    20 dummy :: Maybe Nat.Nat;
    21 dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing];
    22 
    23 }