← All posts tagged work

rufuse
Haskell Спецолимпиада роиссявперде Чего-то у меня мозг вытекает уже через уши. Расскажите почему происходит то, что происходит, а?

type family Migratable (rs :: [RevPair]) :: Constraint where
Migratable (rp1 ': '[]) =
( TopLevel (GetSchema (Head (rp1 ': '[])))
, Known (Sing (GetSchema (Head (rp1 ': '[])))) )
Migratable (rp1 ': rp2 ': tl) =
( Known (Sing (GetSchema (Head (rp1 ': rp2 ': tl))))
, MigrateSchema
(GetSchema (Head (Tail (rp1 ': rp2 ': tl))))
(GetSchema (Head (rp1 ': rp2 ': tl)))
, TopLevel (GetSchema (Head (rp1 ': rp2 ': tl)))
, Migratable (Tail (rp1 ': rp2 ': tl)) )

parseAndValidateRevPairs
:: forall proxy rps
. ( Known (Sing (GetSchema (Head rps))), Known (Sing rps), Migratable rps )
=> proxy rps
-> J.Value
-> ParseResult (JsonRepr (GetSchema (Head rps)))
parseAndValidateRevPairs _ v =
let
rss :: Sing rps
rss = known
stv :: Sing (GetSchema (Head rps))
stv = sGetSchema $ sHead rss
stl :: Sing (Tail rps)
stl = sTail rss
in case stl of
SNil -> parseAndValidateJsonBySing stv v
SCons _ SNil -> parseAndValidateJsonBySing stv v
SCons (SCons _) -> migrate <$> parseAndValidateVersionedJsonByVersions stl v

error:
• Could not deduce (MigrateSchema
(GetSchema n0) (GetSchema (Head rps)))
arising from a use of 'migrate'
from the context: (Known (Sing (GetSchema (Head rps))),
Known (Sing rps),
Migratable rps)
bound by the type signature for:
parseAndValidateRevPairs :: (Known (Sing (GetSchema (Head rps))),
Known (Sing rps), Migratable rps) =>
proxy rps
-> Value
-> ParseResult (JsonRepr (GetSchema (Head rps)))
at /Users/dr/workspace/schematic/.stack-work/intero/intero26044q4W.hs:(124,1)-(129,50)
or from: Tail rps ~ (n0 : n1)
bound by a pattern with constructor:
SCons :: forall a0 (z0 :: [a0]) (n0 :: a0) (n1 :: [a0]).
z0 ~ (n0 : n1) =>
Sing n0 -> Sing n1 -> Sing z0,
in a case alternative
at /Users/dr/workspace/schematic/.stack-work/intero/intero26044q4W.hs:141:5-23
or from: n1 ~ (n2 : n3)
bound by a pattern with constructor:
SCons :: forall a0 (z0 :: [a0]) (n0 :: a0) (n1 :: [a0]).
z0 ~ (n0 : n1) =>
Sing n0 -> Sing n1 -> Sing z0,
in a case alternative
at /Users/dr/workspace/schematic/.stack-work/intero/intero26044q4W.hs:141:14-22
• In the first argument of '(<$>)', namely 'migrate'
In the expression:
migrate <$> parseAndValidateVersionedJsonByVersions stl v
In a case alternative:
SCons (SCons _)
-> migrate <$> parseAndValidateVersionedJsonByVersions stl v
rufuse
work programming admin job Разыскивается человек, желающий поадминить на парт-тайме и обучиться nixos.org Баззворды: centOS, nix, zabbix, ansible, haskell, ruby. Писать на d.redozubov эт antorica.com