Created
November 1, 2019 08:48
-
-
Save b0oh/e46e1d6df4d96a3243835c71d369107d to your computer and use it in GitHub Desktop.
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 Pair exposing (..) | |
type alias Pair1 first second pair = | |
((first -> second -> pair) -> pair) | |
type Pair2 first second pair = | |
Pair2 ((first -> second -> pair) -> pair) | |
-- type Pair3 first second = | |
-- forall pair: Pair3 ((first -> second -> pair) -> pair) | |
type alias Prop1 pair = | |
Pair1 String String pair | |
type alias Prop2 pair = | |
Pair2 String String pair | |
-- type alias Prop3 = | |
-- Pair3 String String | |
make : first -> second -> (first -> second -> pair) -> pair | |
make first_ second_ pair = | |
pair first_ second_ | |
make1 : first -> second -> Pair1 first second pair | |
make1 first_ second_ pair = | |
pair first_ second_ | |
make2 : first -> second -> Pair2 first second pair | |
make2 first_ second_ = | |
Pair2 (\pair -> pair first_ second_) | |
first : ((first -> second -> first) -> first) -> first | |
first pair = | |
pair (\first_ second_ -> first_) | |
first1 : Pair1 first second first -> first | |
first1 pair = | |
pair (\first_ second_ -> first_) | |
first2 : Pair2 first second first -> first | |
first2 (Pair2 pair) = | |
pair (\first_ second_ -> first_) | |
second : ((first -> second -> second) -> second) -> second | |
second pair = | |
pair (\first_ second_ -> second_) | |
second1 : Pair1 first second second -> second | |
second1 pair = | |
pair (\first_ second_ -> second_) | |
second2 : Pair2 first second second -> second | |
second2 (Pair2 pair) = | |
pair (\first_ second_ -> second_) | |
props = | |
let | |
background = | |
make "background" "red" | |
float = | |
make "float" "left" | |
in | |
[ background, float ] | |
props1 : List (Prop1 pair) | |
props1 = | |
let | |
background = | |
make1 "background" "red" | |
float = | |
make1 "float" "left" | |
in | |
[ background, float ] | |
props2 : List (Prop2 pair) | |
props2 = | |
let | |
background = | |
make2 "background" "red" | |
float = | |
make2 "float" "left" | |
in | |
[ background, float ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment