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
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneKindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module FixViaHFix where | |
import Data.Functor.Identity | |
import Data.Kind |
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 cats.Functor | |
import cats.implicits._ | |
import scala.language.higherKinds | |
sealed trait StackR | |
final case class DoneR(result: Int = 1) extends StackR | |
final case class MoreR(acc: StackR, next: Int) extends StackR | |
sealed trait Stack[A] |
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 scala.language.higherKinds | |
import scala.util.Random | |
import scalaz.Scalaz._ | |
import scalaz._ | |
import Circuit.arrowInstance | |
///////////////////////////////////////////////////////////////////////////////////////// | |
// This implementation closely follows the Haskell implementation in the Haskell Wikibook | |
// (https://en.wikibooks.org/wiki/Haskell/Arrow_tutorial). |