Skip to content

Instantly share code, notes, and snippets.

@dcrystalj
Created November 17, 2013 14:25
Show Gist options
  • Save dcrystalj/7513991 to your computer and use it in GitHub Desktop.
Save dcrystalj/7513991 to your computer and use it in GitHub Desktop.
questions
(* kaj tole nardi ubistvu ? *)
datatype ('a, 'b) seznam =
Elementa of ('a * ('a, 'b) seznam)
| Elementb of ('b * ('a, 'b) seznam)
| konec
(* zakaj ni polimorfna *)
fun vsota_el sez =
case sez of
[h] => h
| glava::rep => glava + vsota_el rep
(* zakaj ni option 'a ?*)
datatype 'a option = NEKI of 'a | NIC
fun valof y =
case y of
NEKI x => x
(* zakaj ne prevede exeption list*)
exception EnaDva of int list
handle EnaDva => [0]
(* kaj to dela *)
(List.tabulate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment