4 | ||| For a type `kind`, specify a way of converting the recognised
5 | ||| string into a value.
6 | |||
7 | ||| ```idris example
8 | ||| data SimpleKind = SKString | SKInt | SKComma
9 | |||
10 | ||| TokenKind SimpleKind where
11 | ||| TokType SKString = String
12 | ||| TokType SKInt = Int
13 | ||| TokType SKComma = ()
14 | |||
15 | ||| tokValue SKString x = x
16 | ||| tokValue SKInt x = cast x
17 | ||| tokValue SKComma x = ()
18 | ||| ```
21 | ||| The type that a token of this kind converts to.
24 | ||| Convert a recognised string into a value. The type is determined
25 | ||| by the kind of token.
28 | ||| A token of a particular kind and the text that was recognised.
35 | ||| Get the value of a `Token k`. The resulting type depends upon
36 | ||| the kind of token.