This file contains hidden or 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 TestRes = RouteResult< | |
| Created<JsonValue>, | |
| Coprod!( | |
| BadRequest<JsonValue>, | |
| NotFound<JsonValue>, | |
| InternalServerError<JsonValue> | |
| ), | |
| >; | |
| #[post("/test/<a>")] |
This file contains hidden or 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
| {-# LANGUAGE DeriveGeneric | |
| , DefaultSignatures | |
| , FlexibleInstances | |
| , FlexibleContexts | |
| , KindSignatures | |
| , DataKinds | |
| , TypeOperators | |
| , DeriveAnyClass | |
| , ScopedTypeVariables #-} |
This file contains hidden or 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
| #!/usr/bin/env stack | |
| -- stack script --resolver=lts-8.14 --package recursion-schemes --package transformers --package deriving-compat | |
| {-# LANGUAGE TypeOperators | |
| , DeriveFunctor | |
| , DeriveFoldable | |
| , DeriveTraversable | |
| , DeriveGeneric | |
| , TemplateHaskell | |
| , MultiParamTypeClasses | |
| , FlexibleInstances |
This file contains hidden or 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
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| module Data.Functor.Foldable.Monadic | |
| ( cataM | |
| , anaM | |
| , futuM | |
| ) where | |
| import Protolude |
This file contains hidden or 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
| scala> :paste | |
| // Entering paste mode (ctrl-D to finish) | |
| import inox._ | |
| import inox.trees._ | |
| import inox.trees.dsl._ | |
| import inox.solvers._ | |
| // Exiting paste mode, now interpreting. |
This file contains hidden or 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 shapeless._ | |
| import shapeless.ops.product._ | |
| import shapeless.syntax.std.product._ | |
| case class Foo(a: Int, b: String) | |
| case class Bar(a: Int, b: String, c: Foo) | |
| case class Empty() | |
| case object Object | |
| trait CaseFromProduct[T] { |
This file contains hidden or 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
| /* | |
| * Decompiled with CFR 0_108. | |
| * | |
| * Could not load the following classes: | |
| * const$$anonfun | |
| * const$$anonfun$lamConst | |
| * scala.Function1 | |
| * scala.runtime.AbstractFunction1 | |
| */ | |
| import scala.Function1; |
This file contains hidden or 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
| {-# LANGUAGE RankNTypes #-} | |
| -- Church encoding of various data-types. | |
| -- Very much inspired by Gabriel Gonzalez's talk "Internet of Code": | |
| -- http://begriffs.com/posts/2015-10-16-internet-of-code.html | |
| module Church where | |
| import Prelude hiding (map, sum, foldr, and, not) | |
| -- List |
This file contains hidden or 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
| language: haskell | |
| sudo: false | |
| cache: | |
| directories: | |
| - $HOME/.stack/ | |
| before_install: | |
| - mkdir -p ~/.local/bin |