1-- @inline ConvertableOptions.convertRecordOptionsCons arity=6
2-- @inline ConvertableOptions.convertRecordOptionsNil always
3-- @inline export flub always
4-- @inline export flubImpl never
5module Snapshot.ConvertableOptions01
13import ConvertableOptions (class ConvertOption, class ConvertOptionsWithDefaults, convertOptionsWithDefaults)
14import Data.Maybe (Maybe(..))
18 , baz :: Maybe Boolean
28instance convertFlubBar1 :: ConvertOption Flub "bar" Int String where
29 convertOption _ _ int = show int
31else instance convertFlubBar2 :: ConvertOption Flub "bar" String String where
32 convertOption _ _ str = str
34else instance convertFlubBaz1 :: ConvertOption Flub "baz" Boolean (Maybe Boolean) where
35 convertOption _ _ bool = Just bool
37else instance convertFlubBaz2 :: ConvertOption Flub "baz" (Maybe Boolean) (Maybe Boolean) where
38 convertOption _ _ mb = mb
40else instance convertFlubDefault :: ConvertOption Flub sym a a where
41 convertOption _ _ a = a
43defaultOptions :: { | Optional }
51 . ConvertOptionsWithDefaults Flub { | Optional } { | provided } { | All }
54flub provided = flubImpl all
57 all = convertOptionsWithDefaults Flub defaultOptions provided
59flubImpl :: { | All } -> String
63test1 = flub { bar: "Hello" }
66test2 = flub { foo: 99, bar: "Hello" }
69test3 = flub { foo: 99, bar: "Hello", baz: Just true }
72test4 = flub { foo: 99, bar: 42, baz: true }
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list