Hello,
I have some code like this (the contents don't really matter):
42 data TestChain next = ChainEntry (forall b . TestG b) next
43 | ChainDescribe String (Free TestChain...
44 deriving (Functor)
45
46 -- deriving instance Show a = Show (TestChain
* Niklas Hambüchen m...@nh2.me [2012-12-20 08:47:17+]
Hello,
I have some code like this (the contents don't really matter):
42 data TestChain next = ChainEntry (forall b . TestG b) next
43 | ChainDescribe String (Free TestChain...
44 deriving
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
Control.Category:
quote:
class Category cat where
A class for categories. id and (.)
On 12/17/12 9:45 PM, Christopher Howard wrote:
So you could have...
(coupler . thing) . gadget
Because the coupler and the thing would combine to create a component
with one spare connector. This would then combine with the gadget to
make the final component. However, if you did...
coupler .
Hi Christopher,
a data type can be an instance of Category only if it has kind * - * - *.
It must have 2 type parameters so that you could have types like 'cat a a'.
Some simple examples:
import Prelude hiding (id, (.))
import Control.Category
import Data.Monoid
-- See
On 12/18/12 5:03 PM, Christopher Howard wrote:
Since I received the two responses to my question, I've been trying to
think deeply about this subject, and go back and understand the core
ideas. I think the problem is that I really don't have a clear
understanding of the basics of category
On 12/20/12 6:42 AM, Christopher Howard wrote:
code:
instance Category Integer where
id = 1
(.) = (*)
-- and
instance Category [a] where
id = []
(.) = (++)
---
But these lead to kind mis-matches.
As mentioned in my other email (just posted) the kind mismatch is
2012/12/19 Joachim Breitner m...@joachim-breitner.de:
if Michael Snoyman’s stackage will fly, I’d that would be a good
candidate for a default set.
+10
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Thu, Dec 20, 2012 at 3:47 AM, Niklas Hambüchen m...@nh2.me wrote:
`b' is a rigid type variable bound by
a type expected by the context: TestG b at Clean.hs:49:23
It might be worth rephrasing this error message somehow, although I suspect
it's written to fit into existing
the category of Haskell types and Haskell functions[1]
[1] Note that this may not actually work out to be a category, but the basic
idea is sound.
I would be curious to see this example carefully worked out. I often
hear that Haskell types and Haskell functions constitute a category,
but I
On Thu, 20 Dec 2012, Oleksandr Manzyuk manz...@gmail.com wrote:
the category of Haskell types and Haskell functions[1]
[1] Note that this may not actually work out to be a category, but the basic
idea is sound.
I would be curious to see this example carefully worked out. I often
hear that
On Thu, 20 Dec 2012, Christopher Howard christopher.how...@frigidcode.com
wrote:
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
hi,
how to use Language.Haskell.Interpreter.setImports?
i use it like:
setImports [My.Module]
so that my interpreted modules don't need to:
import My.Module
But i still get:
Not in scope: data constructor `MyType'
What am i doing wrong?
Thanks in advance.
have fun
martin
Hello!
Try doing this first:
loadModules [My.Module]
You may also need to set the searchPath - it defaults to the current
director. Another good function to know about is setTopLevelModules,
which is just like using :load in ghci - it imports everything in the
module, including its imports.
ok, i figured it out so far (just after hitting send ;)
'setImports' makes 'My.Modules' stuff available to the interpreted code
itself (a call to some of my wrapper functions) but not to my module
My.Interpreted.Module where which i use via
setTopLevelModule [My.Interpreted.Module]
So i
On 12/20/2012 03:59 AM, wren ng thornton wrote:
On 12/20/12 6:42 AM, Christopher Howard wrote:
As mentioned in my other email (just posted) the kind mismatch is
because categories are actually monoid-oids[1] not monoids. That is:
class Monoid (a :: *) where
mempty :: a
oh that's neat!
but what to do if MyPrelude is provided by some package?
i get this error:
module `MyPrelude' is a package module
and neither
set [languageExtensions := [PackageImports]]
nor
{-# LANGUAGE PackageImports #-}
helps.
have fun
martin
On 21.12.2012 00:55, Michael Sloan
Yeah, I've run into that too..
It does seem like there ought to be a better way, but in order to get
around that, I just define the imports (or generate) MyPrelude.hs in the
current directory. That file can just consist of import
OtherPackage.MyPrelude.
-Michael
On Thu, Dec 20, 2012 at 4:12
If you require the circuit to be parametric in the value types, you can
limit the types of function you can pass to arr to simple plumbing.
See the netlist example at the end of my Fun of Programming slides (
http://www.soi.city.ac.uk/~ross/papers/fop.html).
I'm running into this same
On 21.12.2012 01:23, Michael Sloan wrote:
Yeah, I've run into that too..
It does seem like there ought to be a better way, but in order to get
around that, I just define the imports (or generate) MyPrelude.hs in
the current directory.
what do you do with the file then? neither loadModules,
Ahh, right! Now that I think harder about it, as far as I know, there is
no way to get Hint to load a module with an extra import. If it doesn't
hide the prelude, then one thing to try would be writing your own
./Prelude.hs file. I'd test this, but I'm not currently on a computer
with GHC.
If
Thanks for the suggestion, Jan. Is there a way to include all of hackage?
Alvaro
On Thu, Dec 20, 2012 at 3:37 AM, Jan Stolarek jan.stola...@p.lodz.plwrote:
I see that the comments are from years ago. Are there any ongoing efforts
to expand the default search set? (Or alternatively, to
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
Control.Category:
quote:
class Category cat where
A class for categories. id and
On Thu, Dec 20, 2012 at 12:53 PM, Oleksandr Manzyuk manz...@gmail.comwrote:
I have no problems with the statement Objects of the category Hask
are Haskell types. Types are well-defined syntactic entities. But
what is a morphism in the category Hask from a to b? Commonly, people
say
On Thu, 20 Dec 2012, Christopher Howard christopher.how...@frigidcode.com
wrote:
On 12/20/2012 03:59 AM, wren ng thornton wrote:
On 12/20/12 6:42 AM, Christopher Howard wrote:
As mentioned in my other email (just posted) the kind mismatch is
because categories are actually monoid-oids[1]
On 12/20/12 10:05 PM, Jay Sulzberger wrote:
What does the code for going backwards looks like? That is,
suppose we have an instance of Category with only one object.
What is the Haskell code for the function which takes the
category instance and produces a monoid thing, like your integers
with
On Thu, 20 Dec 2012, Gershom Bazerman gersh...@gmail.com wrote:
On 12/20/12 10:05 PM, Jay Sulzberger wrote:
What does the code for going backwards looks like? That is,
suppose we have an instance of Category with only one object.
What is the Haskell code for the function which takes the
In my current pondering of the compose-able objects them, I was thinking
it would be useful to have the follow abstractions: Monoids, which were
themselves tuples of Monoids. The idea was something like so:
code:
import Data.Monoid
instance Monoid (Socket2 a b) where
mempty = Socket2
Is Socket2 a b any different from the pair (a,b)?
Assuming Socket2 looks roughly like the following:
import Data.Monoid
data Socket2 a b = Socket2 (a,b)
Then if both a and b are instances of Monoid we can make Socket2 a b into
an instance of Monoid the same way we make (a,b) into a Monoid.
Dnia piątek, 21 grudnia 2012, Radical napisał:
Thanks for the suggestion, Jan. Is there a way to include all of hackage?
Sorry, I don't know any way of doing this.
Janek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
30 matches
Mail list logo