Last active
June 22, 2018 14:43
-
-
Save kylecorbelli/3d36def45f471a78f1aa267c35c6fdc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const safeHead = <T> (list: ReadonlyArray<T>): Maybe<T> => | |
list.length === 0 | |
? Nothing() | |
: Just(list[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment