| author | wenzelm |
| Sat, 06 Oct 2007 22:07:15 +0200 | |
| changeset 24877 | 81147215a12c |
| parent 24628 | 33137422d7fd |
| child 25056 | 743f3603ba8b |
| permissions | -rw-r--r-- |
| 22015 | 1 |
module Codegen where {
|
2 |
||
3 |
import qualified Nat; |
|
| 21147 | 4 |
|
| 22015 | 5 |
class Null a where {
|
6 |
nulla :: a; |
|
7 |
}; |
|
8 |
||
| 22798 | 9 |
heada :: (Codegen.Null b) => [b] -> b; |
| 22751 | 10 |
heada (x : xs) = x; |
| 22015 | 11 |
heada [] = Codegen.nulla; |
| 21147 | 12 |
|
| 24628 | 13 |
instance Codegen.Null (Maybe a) where {
|
| 24421 | 14 |
nulla = Nothing; |
| 22015 | 15 |
}; |
| 21147 | 16 |
|
| 22015 | 17 |
dummy :: Maybe Nat.Nat; |
18 |
dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing]; |
|
| 21147 | 19 |
|
| 22015 | 20 |
} |