Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data List a = Cons a (List a)
- | Nil
- defining Show
- *Main> Cons 0 Nil
- Cons 0 Nil
- *Main> Cons 1 it
- Cons 1 (Cons 0 Nil)
- *Main>
- List a
- List a
- List a
- List a
- List a
- List a
- class List<A>
- {
- }
- class Nil<A> : List<A>
- {
- public Nil() {}
- }
- class Cons<A> : List<A>
- {
- public A Head;
- public List<A> Tail;
- public Cons(A head, List<A> tail)
- {
- this.Head = head;
- this.Tail = tail;
- }
- }
- Cons a (List a)
- Cons { headL :: a, tailL :: List a }
- Cons a (List a)
Add Comment
Please, Sign In to add comment