Re:What I wish I knew when learning OCaml (2018)
by maweki on Tuesday May 03, 2022 @09:20AM
(#31247924)
You would write something like List a = Cons a (List a) | Nil
As :: doesn't start with a letter, it's infix by default. But basically a binary constructor. If you want to create the List [1,2,3] in the prefix notation you might be used to: ::(1,::(2,::(3,[])))
As :: doesn't start with a letter, it's infix by default. But basically a binary constructor. If you want to create the List [1,2,3] in the prefix notation you might be used to: ::(1,::(2,::(3,[])))