Snippets tagged ocaml

• Type inference test

Trying to understand why some type inference used to work in OCaml and not anymore in F#

1 people like this

Posted: 11 years ago by Lasher`

• "99 OCaml" #1

Write a function last : 'a list -> 'a option that returns the last element of a list.

0 people like this

Posted: 9 years ago by DC F#

• "99 OCaml" #3

Find the k'th element of a list. (easy)

0 people like this

Posted: 9 years ago by DC F#

• Replicate the elements of a list a given number of times

One of the 99 OCaml problems rewritten in F#

0 people like this

Posted: 9 years ago by Vladimir Khorikov

• Every spot in the puzzle belongs to a (horizontal) row and a (vertical) column, as well as to one single 3x3 square (which we call "square" for short). At the beginning, some of the spots carry a single-digit number between 1 and 9. The problem is to fill the missing spots with digits in such a way that every number between 1 and 9 appears exactly once in each row, in each column, and in each square.

3 people like this

Posted: 3 years ago by Tomas Petricek

• Attempt to implement a tail calling exception handling combinator

3 people like this

Posted: 9 years ago by Eirik Tsarpalis

• "99 OCaml" #2

Find the last but one (last and penultimate) elements of a list. (easy)

0 people like this

Posted: 9 years ago by DC F#

• "99 OCaml" #4

f# has Seq.length but we ask that you reimplement it. Bonus for a tail recursive solution.

0 people like this

Posted: 9 years ago by DC F#

• Extract a given number of randomly selected elements from a list

One of the problems from https://ocaml.org/learn/tutorials/99problems.html

0 people like this

Posted: 9 years ago by Vladimir Khorikov

• Drop every N'th element from a list

One of the 99 OCaml problems rewritten in F#

7 people like this

Posted: 1 year ago by Vladimir Khorikov