Types and functions for manipulating tiles.
Represents a tile on the game board. Can be empty (
Nothing) or can have a
Just n). By convention, a tile's value is always a power of 2.
Parses a string as a tile. This is the inverse of
parse "2"Just 2
Calculates the rank of a tile.
rank (Just 2)1
rank (Just 2048)11
Renders a tile as a string. This is the inverse of
render (Just 2)"2"