On Mon, Jan 4, 2010 at 1:13 PM, Maciej Piechotka wrote:
> However then we lost the monoid (ok. I haven't send patch but please
> accept[1]) along with alternative/monad plus - which is much more
> popular, standard and useful then Copointed/Comonad.
This point is a self-fulfilling prophecy. We d
> Find other package and send a patch (like category-extras) if it
> applies?
That is good, if I find other package, that satisfies my requirements (or
does, with my patch). But that's a solution for a different case. Consider
(1) and (2) to be conceptually unique.
> [Solution C] Create package.
G'day all.
Quoting Derek Elkins :
Ignoring bottoms the free theorem for fmap can be written:
If h . p = q . g then fmap h . fmap p = fmap q . fmap g
Setting p = id gives
h . id = h = q . g && fmap h . fmap id = fmap q . fmap g
Using fmap id = id and h = q . g we get,
fmap h . fmap id = fmap h
On Tue, 2010-01-05 at 08:01 +0900, Derek Elkins wrote:
> On Tue, Jan 5, 2010 at 7:14 AM, Paul Brauner wrote:
> > Hi,
> >
> > I'm trying to get a deep feeling of Functors (and then pointed Functors,
> > Applicative Functors, etc.). To this end, I try to find lawless
> > instances of Functor that sa
I am using 6.12... are there any good pointers as to how one uses
threadscope?
On Mon, Jan 4, 2010 at 3:14 PM, Neil Mitchell wrote:
> Hi Jamie,
>
> First question, what version of GHC are you using? There are
> significant performance improvements to parallel code in GHC 6.12, so
> it's worth an
Am Dienstag 05 Januar 2010 02:31:20 schrieb Dale Jordan:
> Kind and Generous Haskellers:
>
> I am ensnared in a briar patch of infinite lists and Random gnerators
> trying to use laziness to advantage. Here's my code:
>
> - 8<
> import Control.Applicative
> imp
On Mon, 2010-01-04 at 17:26 -0800, Andrey Sisoyev wrote:
> Hello everybody!
>
Hello
> -
> Consider cases:
> (1)
> I don't want to publish package A, because I doubt anyone will find it
> useful.
> But I develop independent packages B and C, that will be useful
Am Montag 04 Januar 2010 22:25:28 schrieb Daniel Fischer:
> compos ps = fst (tfold mergeSP $ nwise 1 mergeSP (pairwise mergeSP (multip
> ps)))
>
> tfold f (a: ~(b: ~(c:xs)))
> = (a `f` (b `f` c)) `f` tfold f xs
>
> nwise k f xs = let (ys,zs) = splitAt k xs in rfold f ys : nwise
Kind and Generous Haskellers:
I am ensnared in a briar patch of infinite lists and Random gnerators
trying to use laziness to advantage. Here's my code:
- 8<
import Control.Applicative
import Control.Monad
import Control.Monad.Random
import Control.Monad.Sta
Hello everybody!
I'm planning not a small project, and intuition suggests me, that I should
use heavily the rule "separate and rule". So I must separate the project
into many maximum independent and general pieces (packages), make them, and
finally glue it into my project. The pieces and their de
Am Montag 04 Januar 2010 16:30:18 schrieb Will Ness:
> Heinrich Apfelmus quantentunnel.de> writes:
> >
> > (I haven't followed the whole thread, but hopefully I have enough grasp
> > of it to make a useful remark. :))
> >
> > Concerning lists as producer/consumer, I think that's exactly what lazy
On Mon, Jan 4, 2010 at 4:15 PM, Paul Brauner wrote:
> I wonder why this isn't some "classic" category theory result (maybe it is ?)
It doesn't hold in category theory in general.
Haskell (or at least a certain subset) is special - many things that
just *look* category theoretical turn out to ac
There's a patch for it in GHC HEAD by Stephen Blackheath and me, and
an accompanying patch for Cabal.
http://hackage.haskell.org/trac/ghc/ticket/3550
http://hackage.haskell.org/trac/hackage/ticket/591
has the details.
mark
On Mon, Jan 4, 2010 at 10:36 AM, Ivan Miljenovic
wrote:
> If I recall c
I'm not sure if it is of any help, but at the haskell-wiki there's an article
about how to communicate between Haskell and Objective-C using XCode:
http://haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project
-chris
On 4 jan 2010, at 00:36, Ivan Miljenovic wrote:
> If I recall correc
Thanks. I was wondering if the free theorem of fmap entailed that
implication, but I'm not used enough to decipher the output of the tool,
neither am I able to generate it by hand.
However, if this holds (law1 => law2), I wonder why this isn't some
"classic" category theory result (maybe it is ?).
On Mon, Jan 4, 2010 at 3:26 PM, Derek Elkins wrote:
> Yes, I have the same problem...Basically, I'm
> pretty sure the construction of that free theorem doesn't rely on any
> of the actual details...
For a long time I've thought such a higher order free theorem must
exist, and I've mentioned it t
Am Montag 04 Januar 2010 19:16:32 schrieb Will Ness:
> Daniel Fischer web.de> writes:
> > Am Montag 04 Januar 2010 13:25:47 schrieb Will Ness:
> > > Euler's sieve is
> > >
> > > sieve (p:ps) xs = h ++ sieve ps (t `minus` map (p*) [p,p+2..])
> > > where (h,t) = span (< p*p) x
On Tue, Jan 5, 2010 at 8:22 AM, Brent Yorgey wrote:
> On Mon, Jan 04, 2010 at 11:49:33PM +0100, Steffen Schuldenzucker wrote:
>>
>> data Foo a = Foo a
>>
>> instance Functor Foo where
>> fmap f (Foo x) = Foo . f . f $ x
>>
>> Then:
>>
>> fmap id (Foo x) == Foo . id . id $ x == Foo x
>>
>> fmap
On Tue, Jan 5, 2010 at 8:15 AM, Dan Piponi wrote:
> On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins wrote:
>
>> Ignoring bottoms the free theorem for fmap can be written:
>>
>> If h . p = q . g then fmap h . fmap p = fmap q . fmap g
>
> When I play with http://haskell.as9x.info/ft.html I get example
On Mon, Jan 04, 2010 at 11:49:33PM +0100, Steffen Schuldenzucker wrote:
>
> data Foo a = Foo a
>
> instance Functor Foo where
> fmap f (Foo x) = Foo . f . f $ x
>
> Then:
>
> fmap id (Foo x) == Foo . id . id $ x == Foo x
>
> fmap (f . g) (Foo x) == Foo . f . g . f . g $ x
> fmap f . f
On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins wrote:
> Ignoring bottoms the free theorem for fmap can be written:
>
> If h . p = q . g then fmap h . fmap p = fmap q . fmap g
When I play with http://haskell.as9x.info/ft.html I get examples that
look more like:
If fmap' has the same signature as t
On Tue, Jan 5, 2010 at 5:13 AM, Maciej Piechotka wrote:
> On Mon, 2010-01-04 at 07:17 -0700, Luke Palmer wrote:
>> On Mon, Jan 4, 2010 at 6:51 AM, Maciej Piechotka
>> wrote:
>> > About comonad - not exactly as every comonad is copointed and the only
>> > possible way is extract Empty = _|_
>>
>>
On Mon, Jan 4, 2010 at 9:41 PM, Luke Palmer wrote:
> On Mon, Jan 4, 2010 at 12:16 PM, Tom Hawkins wrote:
>> One argument for option 2 is to carry forward datatypes to the target
>> language. For example, if you want to describe a state machine with
>> the state as a type:
>
> What do you mean "c
On Tue, Jan 5, 2010 at 7:14 AM, Paul Brauner wrote:
> Hi,
>
> I'm trying to get a deep feeling of Functors (and then pointed Functors,
> Applicative Functors, etc.). To this end, I try to find lawless
> instances of Functor that satisfy one law but not the other.
>
> I've found one instance that s
Steffen Schuldenzucker wrote:
> data Foo a = Foo a
>
> instance Functor Foo where
> fmap f (Foo x) = Foo . f . f $ x
I think this doesn't typecheck.
Cheers, Jochem
--
Jochem Berndsen | joc...@functor.nl | joc...@牛在田里.com
___
Haskell-Cafe mailing
On Tue, Jan 5, 2010 at 7:49 AM, Steffen Schuldenzucker
wrote:
> Hi Paul,
>
> Paul Brauner wrote:
>> Hi,
>>
>> I'm trying to get a deep feeling of Functors (and then pointed Functors,
>> Applicative Functors, etc.). To this end, I try to find lawless
>> instances of Functor that satisfy one law but
Hi Paul,
Paul Brauner wrote:
> Hi,
>
> I'm trying to get a deep feeling of Functors (and then pointed Functors,
> Applicative Functors, etc.). To this end, I try to find lawless
> instances of Functor that satisfy one law but not the other.
>
> I've found one instance that satisfies fmap (f.g) = f
On Mon, 04 Jan 2010 16:55:44 +0100, Günther Schmidt
wrote:
Hi,
how can I install curl on windows (XP)?
Download the C code for cURL from:
http://curl.haxx.se/download.html
Unpack the source; to avoid problems with scripts, use paths without
spaces.
See the instructions at:
http:
Hi,
I'm trying to get a deep feeling of Functors (and then pointed Functors,
Applicative Functors, etc.). To this end, I try to find lawless
instances of Functor that satisfy one law but not the other.
I've found one instance that satisfies fmap (f.g) = fmap f . fmap g
but not fmap id = id:
data
Am Montag 04 Januar 2010 18:08:42 schrieb Will Ness:
> Daniel Fischer web.de> writes:
> > Am Sonntag 03 Januar 2010 09:54:37 schrieb Will Ness:
> > > The quesion of a memory blowup with the treefolding merge still
> > > remains. For some reason using its second copy for a feeder doesn't
> > > redu
On Mon, Jan 4, 2010 at 12:16 PM, Tom Hawkins wrote:
> One argument for option 2 is to carry forward datatypes to the target
> language. For example, if you want to describe a state machine with
> the state as a type:
What do you mean "carry forward". Can you elaborate on your simple
example? W
Hi Jamie,
First question, what version of GHC are you using? There are
significant performance improvements to parallel code in GHC 6.12, so
it's worth an upgrade. Once you've upgraded you might want to try out
threadscope which is designed to help track down these sorts of
problems.
If you are u
On Mon, 2010-01-04 at 07:17 -0700, Luke Palmer wrote:
> On Mon, Jan 4, 2010 at 6:51 AM, Maciej Piechotka
> wrote:
> > About comonad - not exactly as every comonad is copointed and the only
> > possible way is extract Empty = _|_
>
> I think this module could be cleaned up by disallowing empty li
Hi,
is there a simple example for XSLT via HXT?
You know something like take this xml file, apply this xsl file, dump to
stdout.
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
One argument for option 2 is to carry forward datatypes to the target
language. For example, if you want to describe a state machine with
the state as a type:
data StopLightState = Red | Yellow | Green
With option 1, values of type StopLightState will be resolved at
compile-time, not run-time.
Emil Axelsson chalmers.se> writes:
>
> > For me, a real smart compiler is one that would take in e.g. (sum $
> > take n $
> > cycle $ [1..m]) and spill out a straight up math formula, inside a few ifs
> > maybe (just an aside).
>
> (Also an aside, I couldn't resist...)
>
> Then I'm sure yo
Daniel Fischer web.de> writes:
>
>
> Am Montag 04 Januar 2010 13:25:47 schrieb Will Ness:
>
> > Euler's sieve is
> >
> > sieve (p:ps) xs = h ++ sieve ps (t `minus` map (p*) [p,p+2..])
> > where (h,t) = span (< p*p) xs
>
> Not quite. That's a variant of the postponed fil
On Mon, Jan 4, 2010 at 12:11 PM, Reid Barton wrote:
> On Mon, Jan 04, 2010 at 11:50:57AM -0500, Brandon Simmons wrote:
>> On Sun, Jan 3, 2010 at 2:22 AM, Ivan Lazar Miljenovic
>> wrote:
>> > jberryman writes:
>> >
>> >> This may be a dumb question, but why can we not declare a Monad
>> >> instan
Thanks Jasper ...
Thanks John,
While most of the use case I had in mind seems to fit the EDSL description, I
had some in the proper DSL category as well...
So, my prejudice had been towards option one - and I was unable to visualize a
situation where option 1 would not work - or become too probl
To start with, can you clarify that you are looking for an Embedded DSL
(sometimes called Light Weight DSL)?
A _proper_ DSL has its own interpreter/compiler where an EDSL/LwDSL
leverages the compiler of a host language (in this case, Haskell).
Assuming you're referring to an EDSL, I'll respond. :
Hello,
I see no real reason to use the second approach, unless you're doing
something tremendously new and big. Besides, the first solution is much
easier and will be easier to maintain (in case the back end changes).
Kind regards,
Jasper Van der Jeugt
On Mon, Jan 4, 2010 at 6:14 PM, CK Kashyap
Hi,
I am not sure if I'm using DSL in the right context here but I am referring to
those solutions that allow us to write code in Haskell and generate a target
code source code of another language or even object code for that matter. I am
aware of two ways of achieving this -
1. Implement funct
On Mon, Jan 04, 2010 at 11:50:57AM -0500, Brandon Simmons wrote:
> On Sun, Jan 3, 2010 at 2:22 AM, Ivan Lazar Miljenovic
> wrote:
> > jberryman writes:
> >
> >> This may be a dumb question, but why can we not declare a Monad
> >> instance of a type synonym? This question came to me while working
Daniel Fischer web.de> writes:
>
> Am Sonntag 03 Januar 2010 09:54:37 schrieb Will Ness:
> >
> > The quesion of a memory blowup with the treefolding merge still remains.
> > For some reason using its second copy for a feeder doesn't reduce the
> > memory (as reported by standalone compiled progr
Am Montag 04 Januar 2010 13:25:47 schrieb Will Ness:
> Daniel Fischer web.de> writes:
> > Am Sonntag 03 Januar 2010 09:54:37 schrieb Will Ness:
> > > Daniel Fischer web.de> writes:
> > > > But there's a lot of list constructuion and deconstruction necessary
> > > > for the Euler sieve.
> > >
> >
On Sun, Jan 3, 2010 at 2:22 AM, Ivan Lazar Miljenovic
wrote:
> jberryman writes:
>
>> This may be a dumb question, but why can we not declare a Monad
>> instance of a type synonym? This question came to me while working
>> with the State monad recently and feeling that the requirement that we
>>
For me, a real smart compiler is one that would take in e.g. (sum $ take n $
cycle $ [1..m]) and spill out a straight up math formula, inside a few ifs
maybe (just an aside).
(Also an aside, I couldn't resist...)
Then I'm sure you'd say that Feldspar [1] has a smart compiler :)
The above exp
Heinrich, thanks for some great help and food for thought!
(More on performance of your solution below)
Thanks for describing the background of this problem in detail! I was
mainly asking because I'm always looking for interesting Haskell
topics
that can be turned into a tutorial of sorts, a
Hi,
how can I install curl on windows (XP)?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Heinrich Apfelmus quantentunnel.de> writes:
>
> Will Ness wrote:
> >
> > I keep thinking that storage duplication with span, filter etc. is not
> > really
> > necessary, and can be replaced with some pointer chasing - especially when
> > there's only one consumer present for the generated valu
Am Montag 04 Januar 2010 02:17:06 schrieb Patrick LeBoutillier:
> Hi,
>
> This question didn't get any replies on the beginners list, I thought
> I'd try it here...
Sorry, been occupied with other things. I already took a look, but hadn't
anything
conclusive enough to reply yet.
>
> I've writte
I've heard this a few times and am slowly becoming convinced of it. I'll try
my current use without the Empty and see how it goes.
Given that I've heard this from several places, I'll probably drop Empty.
On Mon, Jan 4, 2010 at 9:17 AM, Luke Palmer wrote:
> On Mon, Jan 4, 2010 at 6:51 AM, Macie
On Mon, Jan 4, 2010 at 6:51 AM, Maciej Piechotka wrote:
> About comonad - not exactly as every comonad is copointed and the only
> possible way is extract Empty = _|_
I think this module could be cleaned up by disallowing empty lists.
You have this nice semantic property that "every clist has a f
On Thu, 2009-12-31 at 04:59 -0500, John Van Enk wrote:
> Hi List,
>
> I recently needed a ring structure (circular list with bi-directional
> access) and didn't see anything obvious on Hackage. I threw something
> together fairly quickly and would like some feedback before tossing it
> on Hackage.
Will Ness wrote:
>
> I keep thinking that storage duplication with span, filter etc. is not really
> necessary, and can be replaced with some pointer chasing - especially when
> there's only one consumer present for the generated values.
>
> What I mean is thinking of lists in terms of produce/
Peter Green wrote:
> Luke Palmer wrote:
>> Yes, by a lot. Sorting requires keeping the entire list in memory.
>> And Haskell lists, unfortunately, are not that cheap in terms of space
>> usage (I think [Int] uses 3 words per element).
>>
>>> but my questions are:
>>>(1) Am I doing anything
Daniel Fischer web.de> writes:
>
>
> Am Sonntag 03 Januar 2010 09:54:37 schrieb Will Ness:
>
> > Daniel Fischer web.de> writes:
> >
> > > But there's a lot of list constructuion and deconstruction necessary for
> > > the Euler sieve.
> >
> > yes. Unless, of course, s smart compiler recognize
Hi John,
> I threw something together fairly quickly and would like some feedback before
> tossing it on Hackage.
>
> I'd really appreciate if some one would:
>
> make sure the code looks goodish (127 lines with full docs)
> make sure my tests look saneish
A similar structure is used in XMonad w
On Sun, 2010-01-03 at 17:34 +0100, Maciej Piechotka wrote:
> I have following problem: I'd like to operate on big files so I'd
> prefere to operate on 'stream' instead of whole file at a time to avoid
> keeping too much in memory. I need to calculate MD5 and compress file.
>
> I tried to use some
Cool, Burat! Those are the first tutorials I've read on TH that have succeeded
in giving me a sense of how I can actually use it! Thanks for writing them up.
:-D
Cheers,
Greg
On Jan 4, 2010, at 3:12 AM, Bulat Ziganshin wrote:
> Hello Patrick,
>
> Monday, January 4, 2010, 5:59:18 AM, you wr
Hello Patrick,
Monday, January 4, 2010, 5:59:18 AM, you wrote:
> I'm guessing no such syntax exists?
you are right. look at
http://www.haskell.org/bz/th3.htm
http://www.haskell.org/bz/thdoc.htm
--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com
__
61 matches
Mail list logo