These commands were taking from the talk Introduction to Advanced Bash Usage by James Pannacciulli
Updated 21 Jan 2017 06:54:53
These commands were taking from the talk Introduction to Advanced Bash Usage by James Pannacciulli
Updated 21 Jan 2017 06:54:53
{-# LANGUAGE MagicHash, TupleSections, TemplateHaskell #-} | |
module Data.Vector.Storable.Bake(bake, unsafeFromAddrLen) where | |
import Data.Typeable | |
import qualified Data.Vector.Storable as VS | |
import Foreign | |
import GHC.Prim | |
import GHC.Ptr | |
import Language.Haskell.TH |
:set prompt "> " | |
:set -isrc | |
:load Main |
{-# LANGUAGE ScopedTypeVariables #-} | |
import qualified Data.IntMap as M | |
import Data.IORef | |
import Data.Unique | |
{-- | |
- listen :: Event a -> (a -> IO ()) -> IO () | |
- fire :: Event a -> a -> IO () | |
-} |
{-# LANGUAGE Arrows #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} |
;; 1. place this in ~/.emacs.d/private/intero/packages.el | |
;; 2. add intero, syntax-checking and auto-completion to your | |
;; ~/.spacemacs layer configuration & remove the haskell layer | |
;; if you were using that before | |
;; 3. make sure you have stack installed http://haskellstack.org | |
;; 4. fire up emacs & open up a stack project's source files |
Numbers in Haskell are typed of course. They also exist as instances of a numeric typeclass hierarchy. I was confused with converting and working with numbers of different types, and not being sure which functions were polymorphic and could work with different numeric types. So I created a little diagram. Do note that the typeclass hierarchy of Haskell actually does somewhat follow the hierarchy of numbers in Math.
With the release of hoogle5, we can now hoogle all local packages.
This let us implement stack hoogle
, which is on the master
branch of stack, but is not yet on a stack release. We'd like you to
try it out before we do!
To upgrade to the latest stack from git, use:
{-# LANGUAGE TypeSynonymInstances #-} | |
import Data.Monoid | |
import Data.Maybe | |
-- How much water does a "histogram" hold? | |
-- | |
-- Inspired by Guy Steele's talk "Four Solutions to a Trivial Problem" | |
-- https://www.youtube.com/watch?v=ftcIcn8AmSY |
{-# LANGUAGE CPP #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-} | |
{-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeOperators, UndecidableInstances #-} | |
#if __GLASGOW_HASKELL__ < 708 | |
#error "requires GHC 7.10 or newer" | |
#endif | |
module Main (main) where |