Created
March 20, 2021 10:00
-
-
Save quartorz/f3928db7403307b5981beb5bf9e85b45 to your computer and use it in GitHub Desktop.
SymbolのリストとTypeから、Typeがすべて等しいRowを作る
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 HomogeneousRow where | |
import Prim.Row (class Cons, class Lacks) | |
import Type.Data.List (Cons', List', Nil') | |
class HomogeneousRow :: forall k. List' -> k -> Row k -> Constraint | |
class HomogeneousRow list k row | list k -> row, row -> list | |
instance homogeneousRow :: HomogeneousRow Nil' typ () | |
else instance homogeneousRowCons :: | |
( Lacks sym row' | |
, Cons sym typ row' row | |
, HomogeneousRow tail typ row' | |
) => | |
HomogeneousRow (Cons' sym tail) typ row |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment