On Sun, Sep 29, 2013 at 9:13 PM, Ryan Newton rrnew...@gmail.com wrote:
Thanks, that's interesting to know (re: Fortress).
Interestingly, in my Fortress days we looked at both using a split-like
interface and at a more foldMap / reduce - like interface, and it seemed
like the latter worked
Oops, this email got stuck in the pipe (flaky internet):
foldMap _ Tip = mempty foldMap f (Bin _ _ v l r) = Foldable.foldMap f l
`mappend` f v `mappend` Foldable.foldMap f r
Btw, from my perspective, one problem with relying on foldMap is that it
treats the whole structure uniformly,
I've got a Partitionable class that I've been using for this purpose:
https://github.com/mikeizbicki/ConstraintKinds/blob/master/src/Control/ConstraintKinds/Partitionable.hs
The function called parallel in the HLearn library will automatically
parallelize any homomorphism from a Partionable to a
On Sat, Sep 28, 2013 at 1:09 PM, Ryan Newton rrnew...@gmail.com wrote:
Hi all,
We all know and love Data.Foldable and are familiar with left folds and
right folds. But what you want in a parallel program is a balanced fold
over a tree. Fortunately, many of our datatypes (Sets, Maps)
Thanks, that's interesting to know (re: Fortress).
Interestingly, in my Fortress days we looked at both using a split-like
interface and at a more foldMap / reduce - like interface, and it seemed
like the latter worked better – it requires a lot less boilerplate for
controlling recursion, and
Hi all,
We all know and love Data.Foldable and are familiar with left folds and
right folds. But what you want in a parallel program is a balanced fold
over a tree. Fortunately, many of our datatypes (Sets, Maps) actually ARE
balanced trees. Hmm, but how do we expose that?
It seems like it
On Sat, Sep 28, 2013 at 1:09 PM, Ryan Newton rrnew...@gmail.com wrote:
Hi all,
We all know and love Data.Foldable and are familiar with left folds and
right folds. But what you want in a parallel program is a balanced fold
over a tree. Fortunately, many of our datatypes (Sets, Maps)
the change... it just needs to be merged in.
Simon
| -Original Message-
| From: Haskell-Cafe [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of
David
| Fox
| Sent: 20 August 2013 22:00
| To: Haskell Cafe
| Subject: [Haskell-cafe] What am I missing? Cycle in type synonym declarations
This file gives me the error Cycle in type synonym declarations Can
anyone tell me why? I'm just trying to write a function to create a
type that is a FooT with the type parameter fixed.
{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH (Q, Dec, TypeQ)
data FooT a = FooT a
foo ::
Hi,
In this case, you have two 'FooT' names: one is the Type and the other
is the Constructor. Perhaps Template Haskell is capturing the wrong
one inside the quote (probably the constructor). When you have name
shadowing, you should always use a lookup function. You can find
these lookup
On Tue, Aug 20, 2013 at 5:00 PM, David Fox d...@seereason.com wrote:
This file gives me the error Cycle in type synonym declarations Can
anyone tell me why? I'm just trying to write a function to create a
type that is a FooT with the type parameter fixed.
{-# LANGUAGE TemplateHaskell #-}
On Tue, Aug 20, 2013 at 2:35 PM, adam vogt vogt.a...@gmail.com wrote:
On Tue, Aug 20, 2013 at 5:00 PM, David Fox d...@seereason.com wrote:
This file gives me the error Cycle in type synonym declarations Can
anyone tell me why? I'm just trying to write a function to create a
type that is a
All, what is wrong w the below code?
I get an type error related to the operation shiftL
import Data.Bits
import Data.Word
import Data.IORef
data Word32s = Word32s { x :: IORef Word32 }
bitfield :: Word32
bitfield = 0
mkbitfield :: Word32 - IO Word32s
mkbitfield i = do the_bf - newIORef i
shiftL has the wrong type: Bits a = a - Int - a
so it is expecting the value in the IORef to be an Int.
Edward
Excerpts from Joerg Fritsch's message of Thu Jul 18 10:08:22 -0700 2013:
All, what is wrong w the below code?
I get an type error related to the operation shiftL
import
Can I easily fix the modifyIORef statement by swapping something ?
--Joerg
On Jul 18, 2013, at 7:19 PM, Edward Z. Yang ezy...@mit.edu wrote:
shiftL has the wrong type: Bits a = a - Int - a
so it is expecting the value in the IORef to be an Int.
Edward
Excerpts from Joerg Fritsch's
Joerg Fritsch, Thu 2013-07-18 @ 19:22:46+0200:
Can I easily fix the modifyIORef statement by swapping something ?
--Joerg
Replace `shiftL` with `flip shiftL` and change the type signature of
`sLbitfield` to take an Int instead of an Integer.
signature.asc
Description: Digital signature
In John Hughes's The Design of Pretty printing library paper, he says:
The implementations which we are trying to derive consist of equations of
a restricted form. We will derive implementations by proving their
constituent equations from the specification. By itself this is no
guarantee
Daryoush Mehrtash dmehrtash at gmail.com writes:
What does restricted form mean?
non-restricted: e.g., f (f x y) z = f x (f y z))
restricted: the shape of function declarations in Haskell
(where lhs is a pattern)
definitions are terminating ...
non-termination: an equation like f x y = f
On URL http://haskell.org/ I get starting Apache page and 404 on
http://haskell.org/hoogle/
URL with starting www - http://www.haskell.org/ seems to be working but
http://www.haskell.org/hoogle/ responds with some ELF file.
Kind regards,
Kirill Zaborsky
On Mon, Jul 15, 2013 at 07:19:12AM -0700, Kirill Zaborsky wrote:
http://www.haskell.org/hoogle/ responds with some ELF file.
After running strings on it, it does seem to be (at least part of) the
hoogle binary.
___
Haskell-Cafe mailing list
The web site is migrating.
IRC says: Topic for #haskell: haskell.org in the middle of migration;
expect turbulence; use www.haskell.org
On Mon, Jul 15, 2013 at 6:19 PM, Kirill Zaborsky qri...@gmail.com wrote:
On URL http://haskell.org/ I get starting Apache page and 404 on
http://hackage.haskell.org/package/intern
what does this package do? OK, I can read efficient hash consing
but what does it mean exactly? and how would I actually use it?
- J.W.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 05/09/2013 12:56 PM, Johannes Waldmann wrote:
http://hackage.haskell.org/package/intern
what does this package do? OK, I can read efficient hash consing
but what does it mean exactly? and how would I actually use it?
I can't tell you what it does, but there is an example -
https://github.com/ekmett/intern/blob/master/examples/Term.hs
sure I found this but that still does not say much.
I known generally what hash consing is
(and that's why I think I might want to use this package)
but I don't see what is the (implied) contract for this implementation:
It looks
On Thu, 2013-05-09 at 11:56 +, Johannes Waldmann wrote:
http://hackage.haskell.org/package/intern
what does this package do? OK, I can read efficient hash consing
but what does it mean exactly? and how would I actually use it?
Hah. I read the same thing and came to exactly the same
Hi cafe,
I use symbols all the time when manipulating code. I vacillate between
using stringtable-atom, symbol, and simple-atom. Unfortunately:
- Stringtable-atom is has a broken build right now (GHC 7.6). (Also
I've had some crashes with it in the past.)
- simple-atom has dependency
On Tue, May 7, 2013 at 2:58 PM, Ryan Newton rrnew...@gmail.com wrote:
Hi cafe,
I use symbols all the time when manipulating code. I vacillate between
using stringtable-atom, symbol, and simple-atom. Unfortunately:
Stringtable-atom is has a broken build right now (GHC 7.6). (Also I've had
How is it decided which Haskell projects get chosen? Do we discuss them here
and take a collective view?
Thanks, Dominic.
PS I should point out I have an interest in the proposal to port charts to use
diagrams
(http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/jbracker/1)
No, if the process is the same this year as the previous one, all potential
mentors and haskell.org gsoc admins (I think) get to vote on each
submission, giving it a score, and then the best N proposals get chosen.
On Wed, May 1, 2013 at 10:34 AM, Dominic Steinitz domi...@steinitz.orgwrote:
Hi. I have ghc-7.6.3 and alex-3.0.5.
When I build https://github.com/jwaldmann/smt-lib
it breaks with Language/SMTLIB/Lexer.x:6:5: Not in scope: `alexAndPred'.
It was working with alex-2.3.5.
I was going t add Can I constrain the alex version in the
cabal file (I recall this is difficult for
Is it just me or have some of the old Haskell Platform releases
disappeared from haskell.org?
The 2010.x links from http://www.haskell.org/platform/prior.html also
point to non-existent pages.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
* Martin Drautzburg martin.drautzb...@web.de [2013-03-04 21:21:30+0100]
On Sunday, 3. March 2013 21:11:21 Roman Cheplyaka wrote:
Admittedly, programming with callbacks is not very pleasant. So we have
an excellent alternative — the continuation monad transformer!
This nested code
On Sunday, 3. March 2013 21:11:21 Roman Cheplyaka wrote:
Admittedly, programming with callbacks is not very pleasant. So we have
an excellent alternative — the continuation monad transformer!
This nested code
something1 $ \x - do
something2 $ \y - do
Hello all,
this was previously posted on Haskell Beginners, but only partially answered.
In Sound.ALSA.Sequencer, there are a number of functions which together set up
a midi environement (client, port, queue). They all have a type, where the
last argument has a type like:
(something.T - IO
On Sun, Mar 3, 2013 at 10:28 AM, Martin Drautzburg martin.drautzb...@web.de
wrote:
Hello all,
this was previously posted on Haskell Beginners, but only partially
answered.
In Sound.ALSA.Sequencer, there are a number of functions which together
set up
a midi environement (client, port,
Hi Martin,
These are called continuations or callbacks. In this case, the term
callback seems to fit better, since the result of continuation is an
IO action.
The common use case for callbacks is when you want to release some
resources after the IO action completes. Let's look at the definition
In C usual way is to set some bit in integer variable by shifting or oring,and
than check flag integer variable by anding with particular flag value.What is
Haskell way?
Thanks. ___
Haskell-Cafe mailing list
The same as C way. You can import Data.Bits and can use the functions.
Prelude import Data.Bits
Prelude Data.Bits Data.Bits.
Data.Bits... Data.Bits.bitDefault Data.Bits.complementBit
Data.Bits.rotate Data.Bits.shift
Data.Bits.testBitDefault
Data.Bits..|.Data.Bits.bitSize
Quoth Branimir Maksimovic bm...@hotmail.com,
In C usual way is to set some bit in integer variable by shifting or oring,
and than check flag integer variable by anding with particular flag value.
What is Haskell way?
Of course you may do the very same thing, if you like. I think if
there's
On Tue, Feb 19, 2013 at 10:11 AM, Branimir Maksimovic bm...@hotmail.comwrote:
In C usual way is to set some bit in integer variable by shifting or
oring,
and than check flag integer variable by anding with particular flag value.
What is Haskell way?
You can do that, but a somewhat more
Brandon Allbery allber...@gmail.com wrote:
In C usual way is to set some bit in integer variable by shifting or
oring, and than check flag integer variable by anding with
particular flag value. What is Haskell way?
You can do that, but a somewhat more idiomatic way would be a list
(or,
I'm curious about the design and trade offs in IO manager, I can point out
two changes that should boost performance:
1. Run an IO manager thread on each capability.
2. Use ONESHOT flag to save a system call.
I wonder is there anything else? It must be interesting.
--
I' m curious about the design and trade offs behind the new IO manager. I
see two changes from the code:
1. Run IO manager thread on each capability.
2. Use ONESHOT flag to save a system call.
Is there other interesting things to know?
Is it possible to use epoll's ET mode to save even more
Sorry for the duplicate post, please ignore this one.
On Sunday, February 17, 2013, yi huang wrote:
I'm curious about the design and trade offs in IO manager, I can point out
two changes that should boost performance:
1. Run an IO manager thread on each capability.
2. Use ONESHOT flag to
Hi,
On Saturday, February 16, 2013, yi huang wrote:
I' m curious about the design and trade offs behind the new IO manager. I
see two changes from the code:
1. Run IO manager thread on each capability.
2. Use ONESHOT flag to save a system call.
Is there other interesting things to know?
I just read this page http://www.haskell.org/haskellwiki/First-class_module. It
seems there was not much no ongoing work on this topic... does somebody
know what happened to first-class modules? what are the actual research
papers about this topic?
Thanks
--
Ismael
docs say:
The call '(lazy e)' means the same as e, but
lazyhttp://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Exts.html#v:lazy
has
a magical strictness property: it is lazy in its first argument, even
though its semantics is strict.
why do i want to use magic during
Apparently using STUarrays in an imperative fashion is fraught with
peril (and the performance of molasses).
Casey
--
--
Regards,
KC
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Thank you. Will do.
On Mon, Sep 17, 2012 at 7:14 AM, Antoine Latter aslat...@gmail.com wrote:
On Sun, Sep 16, 2012 at 5:04 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote:
On 15/09/2012, at 5:14 AM, Chris Heller wrote:
You might want to have a look at the time-recurrence package:
On 15/09/2012, at 5:14 AM, Chris Heller wrote:
You might want to have a look at the time-recurrence package:
http://hackage.haskell.org/package/time-recurrence
For your simple cases you would do something like:
Each second:
starting (UTCTime ...) $ recur secondly
Each minute:
On Sun, Sep 16, 2012 at 5:04 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote:
On 15/09/2012, at 5:14 AM, Chris Heller wrote:
You might want to have a look at the time-recurrence package:
http://hackage.haskell.org/package/time-recurrence
For your simple cases you would do something like:
Antoine has it right, the language is lifted from the RFC.
Chris Heller
SAS - Advanced Analytics
Teragram Research Development
phone: 1-617-576-6800 x54237
mobile: 1-617-460-3643
email: hel...@teragram.com
On Sep 16, 2012, at 7:14 PM, Antoine Latter aslat...@gmail.com wrote:
On Sun, Sep 16,
On Thu, Sep 13, 2012 at 10:29 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
Simple usage, I could make an instance of Enum to UTCTime, so
[utcTime..] could work. But that is so stiff. How if sometimes I want
to step by 1 min, sometimes I want to step by 1 sec?
So I
Consider using the time-lens package.
import Data.Time.Lens
import Data.Lens.Common
List comprehension style:
[modL seconds (+ fromIntegral n) t | n - [0..]]
[modL minutes (+ n) t | n - [0..]]
(you need fromIntegral for seconds, because it is of fractional type in
Data.Time).
iterate
This is nice. Thanks to all.
On Fri, Sep 14, 2012 at 4:03 PM, Roman Cheplyaka r...@ro-che.info wrote:
Consider using the time-lens package.
import Data.Time.Lens
import Data.Lens.Common
List comprehension style:
[modL seconds (+ fromIntegral n) t | n - [0..]]
[modL minutes (+ n)
Hi,
Simple usage, I could make an instance of Enum to UTCTime, so
[utcTime..] could work. But that is so stiff. How if sometimes I want
to step by 1 min, sometimes I want to step by 1 sec?
So I think some way like [ t | addUTCTime last 60 ] could be nice.
But I cannot figure it out
Any
Evan Laforge wrote:
I consider that a strength of the lens approach. If I say 'set
(a.b.c.d) 42 record', 'a', 'b' etc. don't have to be record fields, I
can swap them out for other lenses later on.
I can also easily precompose, e.g. 'setThis = a . b; setThat = b . c'
and encourage people to use
On Fri, Aug 3, 2012 at 10:11 AM, Jonathan Geddes
geddes.jonat...@gmail.comwrote:
The nice part about the SEC functions is that
they compose as regular functions. Lenses are
super powerful in that they form a category.
Unfortunately using categories other than
functions feels a tad unwieldy
Oops, forgot my references
[1] Original post:
http://www.twanvl.nl/blog/haskell/cps-functional-references
[2] polymorphic update support: http://r6.ca/blog/20120623T104901Z.html
[3] another post about these:
http://comonad.com/reader/2012/mirrored-lenses/
On Fri, Aug 3, 2012 at 1:53 PM, Ryan
On 2/08/2012, at 5:34 PM, Jonathan Geddes wrote:
Ouch! And that's not even very deeply nested.
Imagine 4 or 5 levels deep. It really makes
Haskell feel clunky next to `a.b.c.d = val`
that you see in other languages.
I was taught that this kind of thing violates the Law of Demeter
and that an
Isn't this exactly the problem solved by all the lens packages?
Current popular ones are fclabels [0] and data-lens [1].
[0] http://hackage.haskell.org/package/fclabels
[1] http://hackage.haskell.org/package/data-lens
On Thu, Aug 2, 2012 at 7:34 AM, Jonathan Geddes
geddes.jonat...@gmail.com
On 2 Aug 2012, at 09:25, Erik Hesselink wrote:
Isn't this exactly the problem solved by all the lens packages?
Current popular ones are fclabels [0] and data-lens [1].
[0] http://hackage.haskell.org/package/fclabels
[1] http://hackage.haskell.org/package/data-lens
Not sure what all of
Ah yes - the joy of Haskell
It so easy to roll your own, rather than search to find someone else's
(better/more elegant) solution... :-)
On 2 Aug 2012, at 11:41, Erik Hesselink wrote:
On Thu, Aug 2, 2012 at 12:30 PM, Andrew Butterfield
andrew.butterfi...@scss.tcd.ie wrote:
On 2 Aug
On Thu, Aug 2, 2012 at 12:30 PM, Andrew Butterfield
andrew.butterfi...@scss.tcd.ie wrote:
On 2 Aug 2012, at 09:25, Erik Hesselink wrote:
Isn't this exactly the problem solved by all the lens packages?
Current popular ones are fclabels [0] and data-lens [1].
[0]
Richard O'Keefe Said:
Ouch! And that's not even very deeply nested.
Imagine 4 or 5 levels deep. It really makes
Haskell feel clunky next to `a.b.c.d = val`
that you see in other languages.
I was taught that this kind of thing violates the Law of Demeter
and that an object should not be
I'm new to Haskell, but I do like your idea.
I prefer this as a built-in feature because it will create a standard
way of doing this, making the question wich package should I use to
get mutatos? lens-foo, lens-bar, monad-lens, lens-lens-foo-bar, ...?
simply go away.
So, yes, I up-vote your idea
On Thu, Aug 2, 2012 at 9:00 AM, Jonathan Geddes
geddes.jonat...@gmail.com wrote:
Richard O'Keefe Said:
Ouch! And that's not even very deeply nested.
Imagine 4 or 5 levels deep. It really makes
Haskell feel clunky next to `a.b.c.d = val`
that you see in other languages.
I was taught that
Greetings,
tl;dr - What Haskell Records need are
semantic editor combinators for free.
I know this is yet another Record proposal
among many, but none of them out there
strike me as being exactly what I want in
Haskell.
Take the following types from a contrived
example.
type Salary = Integer
Leon Smith wrote:
I am familiar with the source of Control.Concurrent.MVar, and I do see {-#
UNPACK #-}'ed MVars around, for example in GHC's IO manager. What I
should have asked is, what does an MVar# look like? This cannot be
inferred from Haskell source; though I suppose I could
On Tue, Jul 31, 2012 at 7:37 AM, Bertram Felgenhauer
bertram.felgenha...@googlemail.com wrote:
Note that MVar# itself cannot be unpacked -- the StgMVar record will
always be a separate heap object.
One could imagine a couple of techniques to unpack the MVar# itself, and
was curious if GHC
I admit I don't know exactly how MVars are implemented, but given that
they can be aliased and have indefinite extent, I would think that they
look something vaguely like a cdatatype ** var, basically a pointer to an
MVar (which is itself a pointer, modulo some other things such as a thread
I'm not sure I totally understand your question about 'unpacking' an MVar,
but I'm going to assume you mean data structures that use the {-# UNPACK
#-} pragma, like in Control.Concurrent.Future [1] and
Control.Concurrent.NamedLock [2].
Here is how MVar is defined in GHC [3]:
data MVar a =
Let me clarify a bit.
I am familiar with the source of Control.Concurrent.MVar, and I do see {-#
UNPACK #-}'ed MVars around, for example in GHC's IO manager. What I
should have asked is, what does an MVar# look like? This cannot be
inferred from Haskell source; though I suppose I could
First of all, apologise if the question is too broad. The background goes
like this: I've implemented a server program in Haskell for my company
intended to replace the previous one written in C which crashes a lot (and
btw the technology of the company is exclusively C-based). When I chose
On 07/17/2012 08:34 AM, Yifan Yu wrote:
First of all, apologise if the question is too broad. The background goes
like this: I've implemented a server program in Haskell for my company
intended to replace the previous one written in C which crashes a lot (and
btw the technology of the company
On 17 July 2012 22:10, Bardur Arantsson s...@scientician.net wrote:
On 07/17/2012 08:34 AM, Yifan Yu wrote:
I can only tell if I browse the source code. So the question is, how can I
determine all the exceptions that can be thrown by a given function?
Look at its source.
Not sure that's the
On 07/17/2012 10:17 PM, Christopher Done wrote:
On 17 July 2012 22:10, Bardur Arantsson s...@scientician.net wrote:
On 07/17/2012 08:34 AM, Yifan Yu wrote:
I can only tell if I browse the source code. So the question is, how can I
determine all the exceptions that can be thrown by a given
Hello there Yifan,
exception handling should be done on a per-context basis, where the
developer establishes the notion of context. Most of the time this
boils down to releasing resources:
forkIO (doStuffWith h `finally` hClose h)
In more complicated scenarios, where you actually need to
On Wed, Jul 18, 2012 at 4:10 AM, Bardur Arantsson s...@scientician.netwrote:
The most robust way is probably to use a completely independent
supervisor program, e.g. upstart, systemd, runit, etc. These
usually have facilities for restarting the supervised program, and a
rate limit on exactly
On Wed, Jul 18, 2012 at 7:05 AM, Ertugrul Söylemez e...@ertes.de wrote:
exception handling should be done on a per-context basis, where the
developer establishes the notion of context. Most of the time this
boils down to releasing resources:
forkIO (doStuffWith h `finally` hClose h)
too.
Chris
-Original Message-
From: Magicloud Magiclouds [mailto:magicloud.magiclo...@gmail.com]
Sent: 01 June 2012 02:01
To: Chris Dornan
Subject: Re: [Haskell-cafe] What is the difference between runhaskell and
compile?
I see.
Although I am using a UTF-8 environment, but all
On Thu, Jul 12, 2012 at 09:41:43AM +0800, Magicloud Magiclouds wrote:
Sorry for the attachments. They are wireshark files.
May I suggest not sending multi-megabyte files of limited interest down
a widely subscribed list? Contrary to popular belief, bandwidth, time
and spool storage isn't free.
Sorry for that. The problem got solved yesterday.
On Mon, Jul 16, 2012 at 6:01 PM, Lars Viklund z...@acc.umu.se wrote:
On Thu, Jul 12, 2012 at 09:41:43AM +0800, Magicloud Magiclouds wrote:
Sorry for the attachments. They are wireshark files.
May I suggest not sending multi-megabyte files of
: Magicloud Magiclouds [mailto:magicloud.magiclo...@gmail.com]
Sent: 31 May 2012 02:47
To: Chris Dornan
Subject: Re: [Haskell-cafe] What is the difference between runhaskell and
compile?
Hi,
I have compared the files. The .o-es are exactly the same. The .hi-s are
different.
The interface
...@gmail.com]
Sent: 01 June 2012 02:01
To: Chris Dornan
Subject: Re: [Haskell-cafe] What is the difference between runhaskell and
compile?
I see.
Although I am using a UTF-8 environment, but all string I was using were
ASCIIs.
If it is not too much trouble, may I have your LDAP compiled
OK. I am totally confused here. Why Couldn't match expected type
`Jobs k e a' with actual type `M.Map k0 b0'
9|data JobInfo a e = (Exception e) =
10| JobInfo { jobId :: ThreadId
11| , result :: MVar (Either e a) }
12|
13|type Jobs k e a = (Ord k,
Sorry, the last 'a' of line 22 is 'b'.
On Thu, Jun 14, 2012 at 3:19 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I am totally confused here. Why Couldn't match expected type
`Jobs k e a' with actual type `M.Map k0 b0'
9|data JobInfo a e = (Exception e) =
10|
And line 14, should be JobInfo a e.
I must be too sleepy
On Thu, Jun 14, 2012 at 3:30 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Sorry, the last 'a' of line 22 is 'b'.
On Thu, Jun 14, 2012 at 3:19 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I am
Hi Magicloud,
The indentation has been lost in the mail. Could you post your code (preferably
without line numbers) on hpaste.org or similar?
—A
On Thursday, 14 June 2012 at 5:33 PM, Magicloud Magiclouds wrote:
And line 14, should be JobInfo a e.
I must be too sleepy
On Thu, Jun
Sorry, the full code is here:
http://hpaste.org/69972
On Fri, Jun 15, 2012 at 7:09 AM, Arlen Cuss a...@len.me wrote:
Hi Magicloud,
The indentation has been lost in the mail. Could you post your code
(preferably without line numbers) on hpaste.org or similar?
—A
On Thursday, 14 June 2012
Hi,
I've forgotten this.
This is OK:
type Job k a = Map k a
And this is OK:
{-# LANGUAGE RankNTypes #-} -- or LiberalTypeSynonyms?
type Job = forall a. forall k. Map k a
Then how to write it like this?
type Job = Map k a
--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use magiclouds#gmail.com.
On 13 June 2012 19:59, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I've forgotten this.
This is OK:
type Job k a = Map k a
And this is OK:
{-# LANGUAGE RankNTypes #-} -- or LiberalTypeSynonyms?
type Job = forall a. forall k. Map k a
Then how to write it like this?
Do you want to hide the specific types of the job? Presumably to then
define a type JobList = [Job] ?
You can do that with the ExistentialQuantification extension.
type Job = forall k a. Map k a
type JobList = [Job]
??
Note you can't unpack the types k a once you have hidden them. But the
That doesn't require existential quantification, but it'll need Rank-2
types if you ever do anything with Job. Unfortunately, a universally
quantified Job like what you wrote (or what Magicloud seems to want) is
only inhabited by the empty Map.
An existentially quantified Job, as you might get
Mmmmh... no, to do that you need ImpredicativeTypes (which is I believe
about to be deprecated).
You have to declare Job a data, not a type, and use
ExistentialQuantification.
2012/6/13 Ismael Figueroa Palet ifiguer...@gmail.com
Do you want to hide the specific types of the job? Presumably to
Thank you all. I just want to wrap some complex types.
So I learn from all info above, I still have to use forall explicitly
On Wed, Jun 13, 2012 at 9:19 PM, Yves Parès yves.pa...@gmail.com wrote:
Mmmmh... no, to do that you need ImpredicativeTypes (which is I believe
about to be
Hi there,
Thanks for the reply. To be clear, all I want is to avoid having to
type type variables all over the place. What should I do? My original
code with RankNTypes and ImpredicativeTypes does not work
The type Job = forall k a. M.Map k a works now. But function uses
it does not.
(resending to café, turns out I wasn't subbed from this address.)
Hi Magicloud,
This is correct; because you've hidden the type-variables away by universally
quantifying them, there's no more level of specificity you can get back *out*
of them than just some kind of Map (Job = M.Map k b, where
OK. I think I understand a little.
I use Job here just wants to simplify the code. And since I provide
the function as library, I cannot decide what exact type k is. What
should I do?
On Thu, Jun 14, 2012 at 11:23 AM, Arlen Cuss a...@len.me wrote:
(resending to café, turns out I wasn't subbed
On 14 June 2012 14:20, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I think I understand a little.
I use Job here just wants to simplify the code. And since I provide
the function as library, I cannot decide what exact type k is. What
should I do?
Do you know what the type
1 - 100 of 953 matches
Mail list logo