duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class | |
import Prelude hiding (log) | |
-------------------------------------------------------------------------------- | |
-- The API for cloud files. | |
class Monad m => MonadCloud m where | |
saveFile :: Path -> Bytes -> m () |
module Main where | |
import StartApp | |
import String | |
import Html | |
import Html.Events as Html | |
import Html.Attributes as Html | |
import Html.Shorthand exposing (..) | |
import Bootstrap.Html exposing (..) | |
import Html exposing (blockquote) |
module type CELL = sig | |
type 'a cell | |
type 'a exp | |
val return : 'a -> 'a exp | |
val (>>=) : 'a exp -> ('a -> 'b exp) -> 'b exp | |
val cell : 'a exp -> 'a cell exp | |
val get : 'a cell -> 'a exp |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
module Files where | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Either |
module SendMoreMoney where | |
import Data.SBV | |
-- | | |
-- >>> sendMoreMoney | |
-- Solution #1: | |
-- s = 9 :: Integer | |
-- e = 5 :: Integer | |
-- n = 6 :: Integer |
Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.
The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca
-- A port of: http://semantic-domain.blogspot.com/2015/03/abstract-binding-trees.html | |
{-# LANGUAGE DeriveFunctor #-} | |
module ABT where | |
import qualified Data.Foldable as Foldable | |
import Data.Foldable (Foldable) | |
import Data.Set (Set) | |
import qualified Data.Set as Set |
sealed trait Angle { val degrees: Int } | |
private final case object Perpendicular extends Angle { val degrees = 90 } | |
private final case object Straight extends Angle { val degrees = 180 } | |
private final case class Acute(degrees: Int) extends Angle | |
private final case class Obtuse(degrees: Int) extends Angle | |
private final case class Reflex(degrees: Int) extends Angle | |
object Angle { | |
def apply(degrees: Int): Either[String,Angle] = degrees match { | |
case _ if degrees == 90 ⇒ | |
Right(Perpendicular) |
codio@saturn-granite:~/workspace$ cabal test | |
Running 2 test suites... | |
Test suite spec: RUNNING... | |
Test suite spec: PASS | |
Test suite logged to: dist/test/unit-test-example-0.0.0-spec.log | |
Test suite doctest: RUNNING... | |
### Failure in Codec/Base64.hs:14: expression `decode (encode xs) == xs' | |
<interactive>:37:3: | |
Not in scope: ‘polyQu |