This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet
SPC q q- quitSPC w /- split window verticallySPC w- - split window horizontallySPC 1- switch to window 1SPC 2- switch to window 2SPC w c- delete current window
| /* | |
| * flatMap can be implemented in terms of flatten and map | |
| * which can be implemented using reduce | |
| */ | |
| 'use strict'; | |
| // > reduce(function(sum, value) { return sum + value; }, | |
| // . 0, [1,2,3]) | |
| // 6 | |
| var reduce = function(iter, initial, arr) { |
This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet
SPC q q - quitSPC w / - split window verticallySPC w - - split window horizontallySPC 1 - switch to window 1SPC 2 - switch to window 2SPC w c - delete current window| {-# 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 Test.Main where | |
| import Prelude (Applicative, Apply, Functor, Show, Unit(), (<*>), (<>), (<$>), ($), (<<<), id, bind, map, pure, return, unit) | |
| import Control.Applicative.Free (FreeAp(), NaturalTransformation(), liftFreeAp, foldFreeAp) | |
| import Control.Apply (lift2) | |
| import Control.Monad.Eff (Eff()) | |
| import DOM (DOM()) | |
| import DOM.Node.Types (Element()) |
| package half | |
| import scala.math.{pow, round, signum} | |
| import scala.util.Random.nextInt | |
| import java.lang.{Float => JFloat} | |
| /** | |
| * Float16 represents 16-bit floating-point values. | |
| * | |
| * This type does not actually support arithmetic directly. The |
| import shapeless._ | |
| import scalaz._ | |
| import Scalaz._ | |
| object console extends App { | |
| trait Foo[A] { | |
| type B | |
| def value: B |
| {-# LANGUAGE PatternSynonyms #-} | |
| module Polynomial where | |
| import Prelude hiding (Maybe(..)) | |
| class Bifunctor f where | |
| bimap :: (a -> b) -> (c -> d) -> f a c -> f b d | |
| instance Bifunctor (,) where | |
| bimap f g (x, y) = (f x, g y) |
| import scalaz.effect.IO | |
| import scalaz.std.function._ | |
| import scalaz.{Coyoneda, Free, Monad, State, ~>} | |
| object NonFunctor extends App { | |
| // my simple algebra | |
| sealed trait Console[A] | |
| case class PrintLine(msg: String) extends Console[Unit] | |
| case object ReadLine extends Console[String] |