-
-
Save kuribas/f61ee0a2566c7123728c6494800da6d3 to your computer and use it in GitHub Desktop.
nested implicits
This file contains 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
module Main | |
import Data.Maybe | |
import Decidable.Equality | |
import Data.Vect | |
hogefuga : {foo : {len : Nat} -> String -> Vect len String} -> Vect 2 String | |
hogefuga {foo} = foo {len=2} "foobar" | |
motif : {len : Nat} -> String -> Vect len String | |
motif {len} str = replicate len str | |
rap : Vect 2 String | |
rap = hogefuga {foo=motif} | |
This file contains 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
module Main | |
import Data.Maybe | |
import Decidable.Equality | |
import Data.Vect | |
hogefuga : {foo : {a:Type} -> Show a => {len : Nat} -> a -> Vect len String} -> Vect 2 String | |
hogefuga {foo} = foo (the (List String) ["foobar"]) | |
motif : Show a => {len : Nat} -> a -> Vect len String | |
motif {len} str = replicate len (show str) | |
rap : Vect 2 String | |
rap = hogefuga {foo=motif} |
This file contains 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
module Main | |
import Data.Maybe | |
import Decidable.Equality | |
import Data.Vect | |
hogefuga : {foo : {len : Nat} -> String -> Vect len String} -> Vect 2 String | |
hogefuga {foo} = foo {len=2} "foobar" |
This file contains 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
hogefuga : {foo : {a:Type} -> Show a => {len : Nat} -> a -> Vect len String} -> Vect 2 String | |
hogefuga {foo} = foo {a=List String} {len=2} ["foobar"] | |
motif : Show a => {len : Nat} -> a -> Vect len String | |
motif {len} str = replicate len (show str) | |
rap : Vect 2 String | |
rap = hogefuga {foo=motif} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment