Skip to content

Instantly share code, notes, and snippets.

@k-bx

k-bx/out.txt Secret

Created February 4, 2014 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k-bx/70654962d4d98ee52e22 to your computer and use it in GitHub Desktop.
Save k-bx/70654962d4d98ee52e22 to your computer and use it in GitHub Desktop.
hyperloglog-play ➤ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ> :set -XTemplateHaskell
λ> :m +Data.HyperLogLog
λ> import Control.Lens
λ> import Data.Reflection
λ> import Data.Monoid
λ> mempty :: HyperLogLog $(3)
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package tagged-0.7 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package reflection-1.3.2 ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package text-0.11.3.1 ... linking ... done.
Loading package hashable-1.1.2.5 ... linking ... done.
Loading package unordered-containers-0.2.3.0 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package stm-2.4.2 ... linking ... done.
Loading package binary-0.5.1.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package old-time-1.1.0.1 ... linking ... done.
Loading package cereal-0.3.5.2 ... linking ... done.
Loading package transformers-compat-0.1.1.1 ... linking ... done.
Loading package nats-0.1.2 ... linking ... done.
Loading package semigroups-0.12.2 ... linking ... done.
Loading package void-0.6.1 ... linking ... done.
Loading package bytes-0.13.0.1 ... linking ... done.
Loading package comonad-3.1 ... linking ... done.
Loading package distributive-0.4 ... linking ... done.
Loading package generic-deriving-1.5.0 ... linking ... done.
Loading package contravariant-0.4.4 ... linking ... done.
Loading package semigroupoids-3.1 ... linking ... done.
Loading package bifunctors-3.2.0.1 ... linking ... done.
Loading package hashable-extras-0.1.3 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package monads-tf-0.1.0.1 ... linking ... done.
Loading package MonadCatchIO-transformers-0.3.1.0 ... linking ... done.
Loading package comonad-transformers-3.1 ... linking ... done.
Loading package comonads-fd-3.0.3 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package parallel-3.2.0.3 ... linking ... done.
Loading package profunctors-3.3.0.1 ... linking ... done.
Loading package groupoids-3.0.1.1 ... linking ... done.
Loading package semigroupoid-extras-3.0.1 ... linking ... done.
Loading package profunctor-extras-3.3.3.1 ... linking ... done.
Loading package split-0.2.2 ... linking ... done.
Loading package lens-3.9.2 ... linking ... done.
Loading package safecopy-0.8.2 ... linking ... done.
Loading package log-domain-0.7.2 ... linking ... done.
Loading package data-default-class-0.0.1 ... linking ... done.
Loading package data-default-instances-base-0.0.1 ... linking ... done.
Loading package data-default-instances-containers-0.0.1 ... linking ... done.
Loading package dlist-0.6.0.1 ... linking ... done.
Loading package data-default-instances-dlist-0.0.1 ... linking ... done.
Loading package data-default-instances-old-locale-0.0.1 ... linking ... done.
Loading package data-default-0.5.3 ... linking ... done.
Loading package pointed-3.1 ... linking ... done.
Loading package approximate-0.2 ... linking ... done.
Loading package bits-0.3.3 ... linking ... done.
Loading package cereal-vector-0.2.0.0 ... linking ... done.
Loading package hyperloglog-0.1 ... linking ... done.
HyperLogLog {runHyperLogLog = fromList [0,0,0,0,0,0,0,0]}
λ> size (foldr cons mempty [1..10] :: HyperLogLog $(4))
<interactive>:8:13:
No instance for (Cons
Control.Lens.Internal.Review.Reviewed
Data.Functor.Identity.Identity
(HyperLogLog GHC.TypeLits.Nat 4)
(HyperLogLog GHC.TypeLits.Nat 4)
a0
a0)
arising from a use of `cons'
Possible fix:
add an instance declaration for
(Cons
Control.Lens.Internal.Review.Reviewed
Data.Functor.Identity.Identity
(HyperLogLog GHC.TypeLits.Nat 4)
(HyperLogLog GHC.TypeLits.Nat 4)
a0
a0)
In the first argument of `foldr', namely `cons'
In the first argument of `size', namely
`(foldr cons mempty [1 .. 10] :: HyperLogLog $(4))'
In the expression:
size (foldr cons mempty [1 .. 10] :: HyperLogLog $(4))
<interactive>:8:25:
No instance for (Enum a0)
arising from the arithmetic sequence `1 .. 10'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Enum Double -- Defined in `GHC.Float'
instance Enum Float -- Defined in `GHC.Float'
instance Integral a => Enum (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus 20 others
In the third argument of `foldr', namely `[1 .. 10]'
In the first argument of `size', namely
`(foldr cons mempty [1 .. 10] :: HyperLogLog $(4))'
In the expression:
size (foldr cons mempty [1 .. 10] :: HyperLogLog $(4))
<interactive>:8:26:
No instance for (Num a0) arising from the literal `1'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Num Double -- Defined in `GHC.Float'
instance Num Float -- Defined in `GHC.Float'
instance Integral a => Num (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus 19 others
In the expression: 1
In the third argument of `foldr', namely `[1 .. 10]'
In the first argument of `size', namely
`(foldr cons mempty [1 .. 10] :: HyperLogLog $(4))'
λ> size (foldr cons mempty ([1..10] :: [Int]) :: HyperLogLog $(4))
<interactive>:9:13:
No instance for (Cons
Control.Lens.Internal.Review.Reviewed
Data.Functor.Identity.Identity
(HyperLogLog GHC.TypeLits.Nat 4)
(HyperLogLog GHC.TypeLits.Nat 4)
Int
Int)
arising from a use of `cons'
Possible fix:
add an instance declaration for
(Cons
Control.Lens.Internal.Review.Reviewed
Data.Functor.Identity.Identity
(HyperLogLog GHC.TypeLits.Nat 4)
(HyperLogLog GHC.TypeLits.Nat 4)
Int
Int)
In the first argument of `foldr', namely `cons'
In the first argument of `size', namely
`(foldr cons mempty ([1 .. 10] :: [Int]) :: HyperLogLog $(4))'
In the expression:
size (foldr cons mempty ([1 .. 10] :: [Int]) :: HyperLogLog $(4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment