Применить функцию к каждому элементу списка - это просто:
map _ [] = []
map f (x:xs) = f x : map f xs| (defun make-quick-haskell-frame () | |
| "Creates a new frame running haskell-mode." | |
| (make-frame '((name . "Quick Haskell") | |
| (width . 120) | |
| (height . 40))) | |
| (select-frame-by-name "Quick Haskell") | |
| (switch-to-buffer "Haskell") | |
| (haskell-mode)) |
| {-# LANGUAGE StandaloneDeriving, FlexibleContexts, UndecidableInstances #-} | |
| -- Laungh ghci with -fobject-code to make the Fix/Tree trick work (thanks edwardk). | |
| -- courtesy of hpc on #haskell | |
| import Unsafe.Coerce | |
| import Control.Monad.ST | |
| toInteger :: Int -> Integer | |
| isJust :: Maybe a -> Bool | |
| null :: [a] -> Bool |
| -- probably broken | |
| -- no polymorphic kind signatures, which may make things cleaner | |
| {-# OPTIONS_GHC -Wall #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeOperators#-} |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <!-- default ordered fallback list - fallback entity has to be PostScript name --> | |
| <key>default</key> | |
| <array> | |
| <string>LucidaGrande</string> <!-- MAKE sure this matches the kCTFontSystemFontType in CTFontDescriptorCreateForUIType() & TDescriptorSourceImp::CreateDefaultDescriptor()! --> | |
| <string>AppleSymbolsFB</string> | |
| <string>GeezaPro</string> |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| {-# LANGUAGE QuantifiedConstraints, ScopedTypeVariables #-} | |
| import Data.Monoid | |
| -- Note: fails for instances that don't need the Monoid a or Semigroup a | |
| pureDefault :: forall f a. (Functor f, forall a. Monoid a => Monoid (f a)) => a -> f a | |
| pureDefault a = a <$ (mempty :: f ()) | |
| apDefault :: (Functor f, forall a. Semigroup a => Semigroup (f a)) => f (a -> b) -> f a -> f b |
| > {-# LANGUAGE Rank2Types #-} | |
| > | |
| > import Prelude hiding (id) | |
| > import Data.Functor.Constant (Constant(Constant), getConstant) | |
| > import Control.Arrow (Arrow, arr, first, Kleisli(Kleisli), runKleisli, (&&&)) | |
| > import Control.Category ((<<<)) | |
| > import Control.Lens (sequenceAOf) | |
| > import qualified Control.Lens as L | |
| > import qualified Control.Lens.Internal.Setter as LS | |
| > import Data.Profunctor (Profunctor, rmap) |
| #!/bin/bash | |
| # Options / Usage | |
| # put this script in the same directory as your *.cabal file | |
| # it will use the first line of "cabal info ." to determine the package name | |
| # custom options for "cabal haddock" (cabal haddock --help, | |
| # http://www.haskell.org/haddock/doc/html/invoking.html) | |
| CUSTOM_OPTIONS=(--haddock-options='-q aliased') | |
| # hackage server to upload to (and to search uploaded versions for) |
| -- | Echo: a small experimental library for functional reactive programming. | |
| {-# LANGUAGE | |
| GADTs | |
| , GeneralizedNewtypeDeriving | |
| , TemplateHaskell | |
| , RecursiveDo | |
| , MagicHash | |
| , UnboxedTuples | |
| #-} |