Created
June 12, 2014 01:59
-
-
Save Gab-km/104660ef8fd393b7146b to your computer and use it in GitHub Desktop.
[FS0670](https://github.com/pocketberserker/free-monad-fsharp/blob/bfbb9bab3e460aaad9ef2a009e70985c022492fb/FSharp.Monad.Free/CoYoneda.fs#L12) の問題を素晴らしい発想()で解決する案
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
namespace FSharp.Monad | |
type CoYoneda<'U> = | |
abstract Run: obj -> 'U | |
type CoYoneda<'F, 'A>(fi: 'F, k: CoYoneda<'A>) = class end | |
module CoYoneda = | |
let apply fa k = | |
CoYoneda(fa, { new CoYoneda<_> with | |
member this.Run(x) = box x |> k }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment