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
renderEither :: Dynamic t (Either a b) -> m () | |
renderEither eitherD = do | |
uniqEitherD <- holdUniqDynBy (\x y -> isRight x && isRight y || isLeft x && isLeft y) eitherD | |
dyn_ $ ffor uniqEitherD $ \case | |
Left val -> renderLeft $ fromLeft val <$> eitherD | |
Right val -> renderRight $ fromRight val <$> eitherD | |
renderLeft :: Dynamic t a -> m () | |
renderRight :: Dynamic t b -> m () |
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
generate :: [e] -> [Structure e] | |
generate objs = | |
let (otStrs, objs2) = generateFrom @OT objs | |
(ttStrs, objs3) = generateFrom @TT objs2 | |
(btStrs, objs4) = generateFrom @BT objs3 | |
(lStrs, _) = generateFrom @L objs4 | |
in otStrs ++ ttStrs ++ btStrs ++ lStrs | |
-- first element of the tuple is all the structures that could be generated from the given list of objects | |
-- second element is all the objects that remain, i.e., that weren't used to generate one of the structures |
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
backend :: Backend BackendRoute FrontendRoute | |
backend = Backend | |
{ _backend_run = \_ -> do | |
app <- mkApp | |
Warp.run 3000 app | |
, _backend_routeEncoder = backendRouteEncoder | |
} |
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
type ProjectColumnFilter = | |
{ prop :: forall label a r'. IsSymbol label => Show a => Cons label a r' Types.ProjectRow => SProxy label | |
, propFilter :: PropertyFilter | |
} | |
filterProjects :: Pattern -> Array ProjectColumnFilter -> Array Types.Project -> Array Types.Project | |
filterProjects pattern columnFilters projects = | |
Array.filter (\proj -> matchesPattern proj && matchesFilters proj) projects | |
where | |
matches pat val = contains pat (toLower val) |
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
{}: | |
(import ./.obelisk/impl {}).project ./. ({ pkgs, ... }: | |
{ | |
packages = { | |
servant-reflex = pkgs.fetchFromGitHub { | |
owner = "imalsogreg"; | |
repo = "servant-reflex"; | |
rev = "ec8723351c8245f29a88cc5e6250533d2d6f4761"; | |
sha256 = "1r8z95hpl6f5pql1f6a3plczahym09fdnxkcg3a6ildw6chmips0"; | |
}; |