doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Tue Oct 16 17:07:40 2007 +0200 (2007-10-16)
changeset 25056 743f3603ba8b
parent 24628 33137422d7fd
child 25182 64e3f45dc6f4
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 b) => [b] -> b;
    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 a) 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 }