mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-30 15:13:37 +03:00
20 lines
356 B
Idris
20 lines
356 B
Idris
|
|
||
|
import Data.String
|
||
|
|
||
|
typebind infixr 0 :-
|
||
|
autobind infixr 0 `for`
|
||
|
|
||
|
record Container where
|
||
|
constructor (:-)
|
||
|
a1 : Type
|
||
|
a2 : a1 -> Type
|
||
|
|
||
|
const : Type -> Type -> Container
|
||
|
const a b = (_ : a) :- b
|
||
|
|
||
|
test : Maybe (List Double)
|
||
|
test = (_ := ["1", "two", "3"]) `for` Just 3
|
||
|
|
||
|
test2 : Maybe (List Double)
|
||
|
test2 = (_ : String := ["1", "two", "3"]) `for` Just 3
|