This library is depricated in favor of my subhask library.
mikeizbicki / constraintkinds Goto Github PK
View Code? Open in Web Editor NEWImplements common Haskell type classes using the constraint kinds pattern to allow constraints.
Implements common Haskell type classes using the constraint kinds pattern to allow constraints.
This library is depricated in favor of my subhask library.
When building the master version, I get:
Configuring ConstraintKinds-1.2.0.0...
Preprocessing library ConstraintKinds-1.2.0.0...
[1 of 6] Compiling Control.ConstraintKinds.Functor ( src/Control/ConstraintKinds/Functor.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Control/ConstraintKinds/Functor.o )
[2 of 6] Compiling Control.ConstraintKinds.Pointed ( src/Control/ConstraintKinds/Pointed.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Control/ConstraintKinds/Pointed.o )
src/Control/ConstraintKinds/Pointed.hs:25:34:
Not in scope: type constructor or class ‘FunctorConstraint’
Hi,
when trying to compile with GHC 7.4.2 (i.e newest Haskell platform), I get two "Could not deduce" error messages:
$ cabal build
Building ConstraintKinds-0.0.1...
Preprocessing library ConstraintKinds-0.0.1...
[1 of 4] Compiling Control.ConstraintKinds.Functor ( src/Control/ConstraintKinds/Functor.hs, dist/build/Control/ConstraintKinds/Functor.o )
[2 of 4] Compiling Control.ConstraintKinds.Foldable ( src/Control/ConstraintKinds/Foldable.hs, dist/build/Control/ConstraintKinds/Foldable.o )
[3 of 4] Compiling Control.ConstraintKinds.Traversable ( src/Control/ConstraintKinds/Traversable.hs, dist/build/Control/ConstraintKinds/Traversable.o )
src/Control/ConstraintKinds/Traversable.hs:58:36:
Could not deduce (FunctorConstraint [] a,
FunctorConstraint [](f b),
TraversableConstraint [] b,
TraversableConstraint [] a)
arising from a use of traverse' from the context (TraversableConstraint V.Vector a, TraversableConstraint V.Vector b, FunctorConstraint V.Vector (f b), FunctorConstraint V.Vector a, Applicative f) bound by the type signature for traverse :: (TraversableConstraint V.Vector a, TraversableConstraint V.Vector b, FunctorConstraint V.Vector (f b), FunctorConstraint V.Vector a, Applicative f) => (a -> f b) -> V.Vector a -> f (V.Vector b) at src/Control/ConstraintKinds/Traversable.hs:58:5-59 In the second argument of
(<$>)', namely
traverse f (V.toList xs)' In the expression: V.fromList <$> traverse f (V.toList xs) In an equation for
traverse':
traverse f xs = V.fromList <$> traverse f (V.toList xs)
src/Control/ConstraintKinds/Traversable.hs:70:37:
Could not deduce (FunctorConstraint [] a,
FunctorConstraint [](f b),
TraversableConstraint [] b,
TraversableConstraint [] a)
arising from a use of traverse' from the context (TraversableConstraint VU.Vector a, TraversableConstraint VU.Vector b, FunctorConstraint VU.Vector (f b), FunctorConstraint VU.Vector a, Applicative f) bound by the type signature for traverse :: (TraversableConstraint VU.Vector a, TraversableConstraint VU.Vector b, FunctorConstraint VU.Vector (f b), FunctorConstraint VU.Vector a, Applicative f) => (a -> f b) -> VU.Vector a -> f (VU.Vector b) at src/Control/ConstraintKinds/Traversable.hs:70:5-61 In the second argument of
(<$>)', namely
traverse f (VU.toList xs)' In the expression: VU.fromList <$> traverse f (VU.toList xs) In an equation for
traverse':
traverse f xs = VU.fromList <$> traverse f (VU.toList xs)
The second error probably comes from the first.
also its a bit weird to have normal Functor as a Constraint on PointedConstraint
Hi, is there any particular reason why your package cannot be built with dlist 0.7.x?
I'm wondering if multiparameter typeclasses and the mtl
library could be ported :) I'm still a newb at ConstraintKinds, but hopefully I can make this. Thanks for the lib!
The full log:
$ cabal install constraintkinds
Resolving dependencies...
Configuring ConstraintKinds-1.1.0.0...
Building ConstraintKinds-1.1.0.0...
Preprocessing library ConstraintKinds-1.1.0.0...
[1 of 9] Compiling Control.ConstraintKinds.Partitionable ( src/Control/ConstraintKinds/Partitionable.hs, dist/build/Control/ConstraintKinds/Partitionable.o )
src/Control/ConstraintKinds/Partitionable.hs:42:30:
Could not deduce (RealFrac s1) arising from a use of ‘ceiling’
from the context (PartitionableConstraint V.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint V.Vector a) =>
Int -> V.Vector a -> [V.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:33:5-13
The type variable ‘s1’ is ambiguous
Note: there are several potential instances:
instance RealFrac Double -- Defined in ‘GHC.Float’
instance RealFrac Float -- Defined in ‘GHC.Float’
instance Integral a => RealFrac (GHC.Real.Ratio a)
-- Defined in ‘GHC.Real’
In the expression: ceiling
In the expression:
ceiling $ (fromIntegral $ V.length vec) / (fromIntegral n)
In an equation for ‘lenmax’:
lenmax = ceiling $ (fromIntegral $ V.length vec) / (fromIntegral n)
src/Control/ConstraintKinds/Partitionable.hs:42:41:
Could not deduce (Num s1) arising from a use of ‘fromIntegral’
from the context (PartitionableConstraint V.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint V.Vector a) =>
Int -> V.Vector a -> [V.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:33:5-13
The type variable ‘s1’ is ambiguous
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 five others
In the expression: fromIntegral
In the first argument of ‘(/)’, namely
‘(fromIntegral $ V.length vec)’
In the second argument of ‘($)’, namely
‘(fromIntegral $ V.length vec) / (fromIntegral n)’
src/Control/ConstraintKinds/Partitionable.hs:42:70:
Could not deduce (Fractional s1) arising from a use of ‘/’
from the context (PartitionableConstraint V.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint V.Vector a) =>
Int -> V.Vector a -> [V.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:33:5-13
The type variable ‘s1’ is ambiguous
Note: there are several potential instances:
instance Fractional Double -- Defined in ‘GHC.Float’
instance Fractional Float -- Defined in ‘GHC.Float’
instance Integral a => Fractional (GHC.Real.Ratio a)
-- Defined in ‘GHC.Real’
In the second argument of ‘($)’, namely
‘(fromIntegral $ V.length vec) / (fromIntegral n)’
In the expression:
ceiling $ (fromIntegral $ V.length vec) / (fromIntegral n)
In an equation for ‘lenmax’:
lenmax = ceiling $ (fromIntegral $ V.length vec) / (fromIntegral n)
src/Control/ConstraintKinds/Partitionable.hs:55:30:
Could not deduce (RealFrac s0) arising from a use of ‘ceiling’
from the context (PartitionableConstraint VU.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint VU.Vector a) =>
Int -> VU.Vector a -> [VU.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:46:5-13
The type variable ‘s0’ is ambiguous
Note: there are several potential instances:
instance RealFrac Double -- Defined in ‘GHC.Float’
instance RealFrac Float -- Defined in ‘GHC.Float’
instance Integral a => RealFrac (GHC.Real.Ratio a)
-- Defined in ‘GHC.Real’
In the expression: ceiling
In the expression:
ceiling $ (fromIntegral $ VU.length vec) / (fromIntegral n)
In an equation for ‘lenmax’:
lenmax
= ceiling $ (fromIntegral $ VU.length vec) / (fromIntegral n)
src/Control/ConstraintKinds/Partitionable.hs:55:41:
Could not deduce (Num s0) arising from a use of ‘fromIntegral’
from the context (PartitionableConstraint VU.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint VU.Vector a) =>
Int -> VU.Vector a -> [VU.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:46:5-13
The type variable ‘s0’ is ambiguous
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 five others
In the expression: fromIntegral
In the first argument of ‘(/)’, namely
‘(fromIntegral $ VU.length vec)’
In the second argument of ‘($)’, namely
‘(fromIntegral $ VU.length vec) / (fromIntegral n)’
src/Control/ConstraintKinds/Partitionable.hs:55:71:
Could not deduce (Fractional s0) arising from a use of ‘/’
from the context (PartitionableConstraint VU.Vector a)
bound by the type signature for
partition :: (PartitionableConstraint VU.Vector a) =>
Int -> VU.Vector a -> [VU.Vector a]
at src/Control/ConstraintKinds/Partitionable.hs:46:5-13
The type variable ‘s0’ is ambiguous
Note: there are several potential instances:
instance Fractional Double -- Defined in ‘GHC.Float’
instance Fractional Float -- Defined in ‘GHC.Float’
instance Integral a => Fractional (GHC.Real.Ratio a)
-- Defined in ‘GHC.Real’
In the second argument of ‘($)’, namely
‘(fromIntegral $ VU.length vec) / (fromIntegral n)’
In the expression:
ceiling $ (fromIntegral $ VU.length vec) / (fromIntegral n)
In an equation for ‘lenmax’:
lenmax
= ceiling $ (fromIntegral $ VU.length vec) / (fromIntegral n)
Failed to install ConstraintKinds-1.1.0.0
cabal: Error: some packages failed to install:
ConstraintKinds-1.1.0.0 failed during the building phase. The exception was:
ExitFailure 1
It is used as (direct/indirect) dependency on HLearn and build against LTS-3.20:
Configuring ConstraintKinds-1.1.0.0...
Building ConstraintKinds-1.1.0.0...
Preprocessing library ConstraintKinds-1.1.0.0...
[1 of 9] Compiling Control.ConstraintKinds.Partitionable ( src/Control/ConstraintKinds/Partitionable.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Control/ConstraintKinds/Partitionable.o )
[2 of 9] Compiling Control.ConstraintKinds.Functor ( src/Control/ConstraintKinds/Functor.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Control/ConstraintKinds/Functor.o )
[3 of 9] Compiling Control.ConstraintKinds.Pointed ( src/Control/ConstraintKinds/Pointed.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Control/ConstraintKinds/Pointed.o )
[4 of 9] Compiling Control.ConstraintKinds.Foldable ( src/Control/ConstraintKinds/Foldable.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Control/ConstraintKinds/Foldable.o )
/tmp/stack16346/ConstraintKinds-1.1.0.0/src/Control/ConstraintKinds/Foldable.hs:58:10:
Ambiguous occurrence ‘Foldable’
It could refer to either ‘Control.ConstraintKinds.Foldable.Foldable’,
defined at src/Control/ConstraintKinds/Foldable.hs:26:1
or ‘P.Foldable’,
imported from ‘Prelude’ at src/Control/ConstraintKinds/Foldable.hs:20:1-36
(and originally defined in ‘Data.Foldable’)
/tmp/stack16346/ConstraintKinds-1.1.0.0/src/Control/ConstraintKinds/Foldable.hs:76:10:
Ambiguous occurrence ‘Foldable’
It could refer to either ‘Control.ConstraintKinds.Foldable.Foldable’,
defined at src/Control/ConstraintKinds/Foldable.hs:26:1
or ‘P.Foldable’,
imported from ‘Prelude’ at src/Control/ConstraintKinds/Foldable.hs:20:1-36
(and originally defined in ‘Data.Foldable’)
/tmp/stack16346/ConstraintKinds-1.1.0.0/src/Control/ConstraintKinds/Foldable.hs:90:10:
Ambiguous occurrence ‘Foldable’
It could refer to either ‘Control.ConstraintKinds.Foldable.Foldable’,
defined at src/Control/ConstraintKinds/Foldable.hs:26:1
or ‘P.Foldable’,
imported from ‘Prelude’ at src/Control/ConstraintKinds/Foldable.hs:20:1-36
(and originally defined in ‘Data.Foldable’)
/tmp/stack16346/ConstraintKinds-1.1.0.0/src/Control/ConstraintKinds/Foldable.hs:105:10:
Ambiguous occurrence ‘Foldable’
It could refer to either ‘Control.ConstraintKinds.Foldable.Foldable’,
defined at src/Control/ConstraintKinds/Foldable.hs:26:1
or ‘P.Foldable’,
imported from ‘Prelude’ at src/Control/ConstraintKinds/Foldable.hs:20:1-36
(and originally defined in ‘Data.Foldable’)
As part of this blog post (http://izbicki.me/blog/gausian-distributions-are-monoids) I need to install HLearn-distributions
, which depends on ConstraintKinds
. But I get this error. Is there anything else I can do to help?
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ git clone git://github.com/mikeizbicki/ConstraintKinds.git
$ ghc Control/ConstraintKinds.hs
[1 of 4] Compiling Control.ConstraintKinds.Functor ( Control/ConstraintKinds/Functor.hs, Control/ConstraintKinds/Functor.o )
[2 of 4] Compiling Control.ConstraintKinds.Foldable ( Control/ConstraintKinds/Foldable.hs, Control/ConstraintKinds/Foldable.o )
[3 of 4] Compiling Control.ConstraintKinds.Traversable ( Control/ConstraintKinds/Traversable.hs, Control/ConstraintKinds/Traversable.o )
Control/ConstraintKinds/Traversable.hs:58:36:
Could not deduce (FunctorConstraint [] a,
FunctorConstraint [] (f b),
TraversableConstraint [] b,
TraversableConstraint [] a)
arising from a use of `traverse'
from the context (TraversableConstraint V.Vector a,
TraversableConstraint V.Vector b,
FunctorConstraint V.Vector (f b),
FunctorConstraint V.Vector a,
Applicative f)
bound by the type signature for
traverse :: (TraversableConstraint V.Vector a,
TraversableConstraint V.Vector b, FunctorConstraint V.Vector (f b),
FunctorConstraint V.Vector a, Applicative f) =>
(a -> f b) -> V.Vector a -> f (V.Vector b)
at Control/ConstraintKinds/Traversable.hs:58:5-59
In the second argument of `(<$>)', namely
`traverse f (V.toList xs)'
In the expression: V.fromList <$> traverse f (V.toList xs)
In an equation for `traverse':
traverse f xs = V.fromList <$> traverse f (V.toList xs)
traverse f xs = V.fromList <$> traverse f (V.toList xs)
Control/ConstraintKinds/Traversable.hs:70:37:
Could not deduce (FunctorConstraint [] a,
FunctorConstraint [] (f b),
TraversableConstraint [] b,
TraversableConstraint [] a)
arising from a use of `traverse'
from the context (TraversableConstraint VU.Vector a,
TraversableConstraint VU.Vector b,
FunctorConstraint VU.Vector (f b),
FunctorConstraint VU.Vector a,
Applicative f)
bound by the type signature for
traverse :: (TraversableConstraint VU.Vector a,
TraversableConstraint VU.Vector b,
FunctorConstraint VU.Vector (f b), FunctorConstraint VU.Vector a,
Applicative f) =>
(a -> f b) -> VU.Vector a -> f (VU.Vector b)
at Control/ConstraintKinds/Traversable.hs:70:5-61
In the second argument of `(<$>)', namely
`traverse f (VU.toList xs)'
In the expression: VU.fromList <$> traverse f (VU.toList xs)
In an equation for `traverse':
traverse f xs = VU.fromList <$> traverse f (VU.toList xs)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.