Skip to content

Instantly share code, notes, and snippets.

@dminuoso

dminuoso/f.hs Secret

Last active November 21, 2022 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/b4deb2d5e5e53e8f414973697a635e40 to your computer and use it in GitHub Desktop.
Save dminuoso/b4deb2d5e5e53e8f414973697a635e40 to your computer and use it in GitHub Desktop.
gluedRoute2 :: Parseable a
=> Parseable b
-> String
-> String
-> (a -> b -> ActionM r)
-> ActionM r
gluedRoute2 a b f = get (buildRoute [a, b]) (f <$> param a <*> param b )
gluedRoute3 :: Parseable a
=> Parseable b
=> Parseable c
-> String
-> String
-> String
-> (a -> b -> c -> ActionM r)
-> ActionM r
gluedRoute3 a b c f = get (buildRoute [a, b, c]) (f <$> param a <*> param b <*> param c)
gluedRoute4 :: Parseable a
=> Parseable b
=> Parseable c
=> Parseable d
-> String
-> String
-> String
-> String
-> (a -> b -> c -> d -> ActionM r)
-> ActionM r
gluedRoute4 a b c d f = get (buildRoute [a, b, c, d]) (f <$> param a <*> param b <*> param c <*> param d)
buildRoute :: [String] -> String
buildRoute ls = "/:" <> intercalate "/:" ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment