I think the history of generics in Java is
Pizza (http://pizzacompiler.sourceforge.net/) -
GJ (http://lamp.epfl.ch/pizza/gj/) -
Java
I think that if you consider that history, and in particular the Pizza
compiler, then the connection to FP becomes rather obvious.
Cheers,
Andres
Hello,
Please advise on existing serialization libraries.
I need a simple way to serialize Data.List and Data.Map to plain text
files.
Thanks,
Dmitri
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 9 June 2011 17:23, Dmitri O.Kondratiev doko...@gmail.com wrote:
Hello,
Please advise on existing serialization libraries.
I need a simple way to serialize Data.List and Data.Map to plain text
files.
Well, the obvious solution is to just use show and read... though if
you want something
If you want plain text serialization, writeFile output.txt . show
and fmap read (readFile output.txt) should suffice...
Max
On 9 June 2011 08:23, Dmitri O.Kondratiev doko...@gmail.com wrote:
Hello,
Please advise on existing serialization libraries.
I need a simple way to serialize Data.List
Binary should be pretty easy to use (and more advisable if you need
performance), since it defines the Binary instance for every basic type,
including of course Map.
I don't know about cereal, but I suppose it will be pretty much the same.
The major difference is that binary offers lazy
Malcolm Wallace malcolm.wallace at me.com writes:
data Bar f a = Foo f = Bar {bar :: f a}
The class context on the data constructor buys you nothing extra in terms of
expressivity in the language.
All it does is force you to repeat the context on every function that uses
the
Were templates an original feature of C++ or did they appear in a revision
of the langage ?
Because C++ appeared in 1982 and Haskell in 1990.
But of course, the ML languages are older, so maybe Bjarne Stoustrup took
inspiration from them. (Anyway, functional features picked up in the
mainstream
On Thu, Jun 9, 2011 at 11:31 AM, Max Bolingbroke batterseapo...@hotmail.com
wrote:
If you want plain text serialization, writeFile output.txt . show
and fmap read (readFile output.txt) should suffice...
Max
This is really a simple way that I like, thanks. Do I understand this right,
that
The SIGPLAN Programming Languages Software Award
For 2011, the winners of the award are
Simon Peyton Jones and Simon Marlow of
Microsoft Research, Cambridge, for GHC
Congratulations!
Well deserved recognition for visionary ideas backed by
so many years of hard work.
-Yitz
On 9 June 2011 09:02, Yves Parès limestr...@gmail.com wrote:
Were templates an original feature of C++ or did they appear in a revision
of the langage ?
Because C++ appeared in 1982 and Haskell in 1990.
Templates were a later addition to C++. There is a strong tradition of
generics in OO and
It is 32 bits, I'm sure.
Besides the 32-bit stack manipulation, it uses eax and ecx to hold two
32-bit parts of the 64-bit number.
Best regards,
Rafael
On Thu, Jun 9, 2011 at 02:54, Scott Lawrence byt...@gmail.com wrote:
On 06/09/2011 01:47 AM, Jason Dagit wrote:
Have you checked this by
This really sucks. Not even LLVM is ported to 64-bit Windows.
This is mainly because Windows uses 32-bit pointers for compatibility.
http://archive.gamedev.net/reference/programming/features/20issues64bit/
Atc
Rafael
On Thu, Jun 9, 2011 at 08:04, Rafael Gustavo da Cunha Pereira Pinto
Hi
Anyone out there got an elegant solution to being able to fork a haskell thread
and replace its 'stdin' ?
Why do I want this - well I'm using the pcap library and I want to uncompress
data to feed into 'openOffile' (which will take - to designate read from
stdin). Yes I can create a
On Thu, Jun 2, 2011 at 7:52 AM, Johan Tibell johan.tib...@gmail.com wrote:
I've decided to stick it in a blog post, add some pictures, and
elaborate some more (e.g. provide numbers for all containers and for
Text, so people can refer to the post when needed).
I ended up writing two blog posts:
2011/6/9 Stephen Tetley stephen.tet...@gmail.com:
On 9 June 2011 09:02, Yves Parès limestr...@gmail.com wrote:
Were templates an original feature of C++ or did they appear in a revision
of the langage ?
Because C++ appeared in 1982 and Haskell in 1990.
Templates were a later addition to C++.
On Thu, Jun 9, 2011 at 09:46, DavidA polyom...@f2s.com wrote:
I think that's exactly what the original poster is complaining about. As a
real-
life example, consider
data Graph a = Ord a = G [a] [[a]]
My intention is that whenever I have a Graph a, I want to be able to use the
Ord
On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
If you don't mind being tied to GHC you can use hDuplicateTo from
GHC.IO.Handle [1]. You can also use dupTo
On Jun 8, 2011, at 11:17 PM, Gregory Guthrie wrote:
I rather had the feeling expressed by Robert Harper:
Once you're in the IO monad, you're stuck there forever, and are
reduced to Algol-style imperative programming.
(http://existentialtype.wordpress.com/2011/05/01/of-course-ml-has-monads/
Can this be extended to records, without redundant repetition?
data Baz f a = Baz {baz :: Foo f = f a, baz2 :: Foo f = f a}
The type constraint for baz2 adds no information, as it's the same f as baz,
but I can't leave it out.
- Original Message -
From: Daniel Schüssler
Correction: I meant
data Baz f a = Baz (Foo f = f a)
(Dropped the 'forall', which would make the inner 'f' have nothing to do with
the type parameter 'f' of 'Baz')
On 2011-June-09 Thursday 01:07:13 Daniel Schüssler wrote:
Hello,
you might be thinking of this type?
{-# LANGUAGE
You could do something like this, but admittedly it appears slightly clunky:
newtype Baz f a = Baz (Foo f = BazInner f a)
data BazInner f a = BazInner { baz :: f a, baz2 :: f a }
instance Foo (Baz f) where
foo a = Baz (let b = foo a in BazInner b b)
Cheers,
Daniel
On 2011-June-09
Greetings Cafe,
What would you recommend as a Haskell-based means of interactively
reading and writing mathematical formulae?
As a toy example, what might I use to write a program which presents
the user with
Please simplify the expression: \pi x^2 + 3\pi x^2
(Where the TeX-style
Malcolm Wallace malcolm.wallace at me.com writes:
The class context on the data constructor buys you nothing extra in terms of
expressivity in the language.
All it does is force you to repeat the context on every function that uses the
datatype. For this reason, the
language committee has
Quoth Erik Hesselink hessel...@gmail.com,
On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com
wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
If you don't mind being tied to GHC you can use hDuplicateTo
On Thu, Jun 9, 2011 at 16:40, Donn Cave d...@avvanta.com wrote:
Quoth Erik Hesselink hessel...@gmail.com,
On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com
wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
Ae you looking to do this in a web application, or client-side? Since one
of your requirements is to display a typeset equation, that makes a bit of
difference. In a web-based setting, the best way to do that is probably
MathML, whereas a GUI will be a bit harder.
On Jun 9, 2011 8:24 AM, Jacek
(I originally sent this reply from the wrong address, see below)
On Jun 9, 2011, at 11:03 AM, Daniel Patterson wrote:
Also if you are doing this for web, I haven't used it personally (yet), but
http://www.mathjax.org/ looks really good... would allow you to actually just
write it in LaTeX
Hi Dmitri,
On 9 June 2011 09:13, Dmitri O.Kondratiev doko...@gmail.com wrote:
I wonder how Haskell will distribute memory between the buffer for
sequential element access (list elements, map tree nodes) and memory for
computation while reading in list, Data.Map from file?
Your list only has
On Thu, Jun 9, 2011 at 7:23 PM, Max Bolingbroke
batterseapo...@hotmail.comwrote:
Hi Dmitri,
On 9 June 2011 09:13, Dmitri O.Kondratiev doko...@gmail.com wrote:
I wonder how Haskell will distribute memory between the buffer for
sequential element access (list elements, map tree nodes) and
There's also http://hackage.haskell.org/package/texmath
which converts LaTeX to MathML, and even handles LaTeX
macros. The problem is that MathML support in browsers
is still spotty.
http://hackage.haskell.org/packages/archive/texmath/0.5.0.1/doc/html/Text-TeXMath-Types.html
contains types for
On Thu, Jun 9, 2011 at 07:40, Neil Davies semanticphilosop...@gmail.com wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
File descriptors/file handles are per process, not per thread, on
(almost?) every OS ghc supports. You'll
Hello café!
This mail is literate haskell
I have some difficulties with understanding how bang patterns and seq
works.
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Control.Monad.Trans.State.Strict
leak :: State Int ()
leak = do
a - get
put (a+1)
leak
This function
Is it not:
noLeak :: State Int ()
noLeak = do
a - get
** * let a' = (a + 1)
a' `seq` put a'*
noLeak
??
2011/6/9 Alexey Khudyakov alexey.sklad...@gmail.com
Hello café!
This mail is literate haskell
I have some difficulties with understanding how bang patterns and seq
works.
Thanks
That is what I thought. I'll stick with what I'm doing at present which is to
use temporary files - don't want to get into separate processes which I then
have to co-ordinate.
Cheers
Neil
On 9 Jun 2011, at 17:01, Brandon Allbery wrote:
On Thu, Jun 9, 2011 at 07:40, Neil Davies
On Thursday 09 June 2011, 18:09:44, Yves Parès wrote:
Is it not:
noLeak :: State Int ()
noLeak = do
a - get
** * let a' = (a + 1)
a' `seq` put a'*
noLeak
??
Alternatively,
noLeak = do
a - get
a `seq` put (a+1)
noLeak
or
noLeak = do
a - get
put $! a+1
On 2011 Jun 9, at 16:59, Chris Smith wrote:
Ae you looking to do this in a web application, or client-side?
Since one of your requirements is to display a typeset equation,
that makes a bit of difference. In a web-based setting, the best
way to do that is probably MathML, whereas a GUI
On 09.06.2011 20:09, Yves Parès wrote:
Is it not:
noLeak :: State Int ()
noLeak = do
a - get
** *let a' = (a + 1)
a' `seq` put a'*
noLeak
??
Indeed. Now I understand. It didn't work for me earlier because of
different behavior of 'forever' in ghci and compiled code.
This
On Thursday 09 June 2011, 18:41:40, Alexey Khudyakov wrote:
On 09.06.2011 20:09, Yves Parès wrote:
Is it not:
noLeak :: State Int ()
noLeak = do
a - get
** *let a' = (a + 1)
a' `seq` put a'*
noLeak
??
Indeed. Now I understand. It didn't work for me
On 09/06/2011 06:54 AM, Scott Lawrence wrote:
On 06/09/2011 01:47 AM, Jason Dagit wrote:
Have you checked this by looking at the generated assembly? I
generated some assembly from GHC on windows. Here is what it looks
ilke:
http://hpaste.org/47610
My assembly-fu is not strong enough to tell
Hello.
I'm writing a small tcp server with that can handle connections and
answer by rules writen in a small script that can be interpreted by server.
For this purpose I've written an interpreter that has type
ErrorT MyError (StateT ScriptState IO)
so I can call native IO function in that
Am 09.06.2011 19:44, schrieb Andrew Coppin:
On 09/06/2011 06:54 AM, Scott Lawrence wrote:
On 06/09/2011 01:47 AM, Jason Dagit wrote:
Have you checked this by looking at the generated assembly? I
generated some assembly from GHC on windows. Here is what it looks
ilke:
http://hpaste.org/47610
On Thu, 9 Jun 2011, Jacek Generowicz wrote:
On 2011 Jun 9, at 16:59, Chris Smith wrote:
Ae you looking to do this in a web application, or client-side? Since one
of your requirements is to display a typeset equation, that makes a bit of
difference. In a web-based setting, the best way to
On Thu, Jun 9, 2011 at 3:14 PM, Alexander V Vershilov
alexander.vershi...@gmail.com wrote:
Hello.
I'm writing a small tcp server with that can handle connections and
answer by rules writen in a small script that can be interpreted by server.
For this purpose I've written an interpreter that
On Thu, 9 Jun 2011, Neil Davies wrote:
Anyone out there got an elegant solution to being able to fork a haskell thread
and replace its 'stdin' ?
Why do I want this - well I'm using the pcap library and I want to uncompress data to
feed into 'openOffile' (which will take - to designate read
On the other hand, I still think it would be worth actually
benchmarking this stuff to see how much difference it makes. Wouldn't
surprise me if the CPU designers did some clever trickery with
pipelining and superscalar execution to make two adjacent 32-bit
instructions execute the same way as a
Hello.
Thu, Jun 09, 2011 at 01:40:51PM -0500, Antoine Latter wrote
On Thu, Jun 9, 2011 at 3:14 PM, Alexander V Vershilov
alexander.vershi...@gmail.com wrote:
Hello.
I'm writing a small tcp server with that can handle connections and
answer by rules writen in a small script that can be
On Thu, Jun 9, 2011 at 1:53 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I'm still left wondering if using 32-bit instructions to manipulate 64-bit
values is actually that much slower. Back in the old days of non-pipelined,
uniscalar CPUs, it would certainly have been the case. Today's
On 09/06/2011 08:44 PM, austin seipp wrote:
On Thu, Jun 9, 2011 at 1:53 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I'm still left wondering if using 32-bit instructions to manipulate 64-bit
values is actually that much slower.
The problem is you're probably going to need to spill
On Thu, Jun 9, 2011 at 4:06 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Too bad GHC doesn't support inline assembly yet... (Or does it? I know it
supports inline Core now.)
Is this new in 7.2?
Antoine
___
Haskell-Cafe mailing list
Hi Everybody,
I have a function which computes a fixed point in terms of iterate:
equivalenceClosure :: (Ord a) = Relation a - Relation a
equivalenceClosure = fst . List.head-- guaranteed to
exist
. List.dropWhile (uncurry (/=)) -- removes pairs that
are not
I think there is a tendency to look at IO as bad because pure code is so
much better. But it's important to keep things in perspective - the
existence of something better doesn't make something bad. IO is still
better than the best of most other languages.
I have been bashing IO from time
On 9/06/2011, at 8:02 PM, Yves Parès wrote:
Were templates an original feature of C++ or did they appear in a revision of
the langage ?
The latter. C with classes did not have multiple inheritance, exceptions, or
templates.
Note that C++ templates are *not* the same kind of animal as
On Thu, Jun 9, 2011 at 2:06 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Too bad GHC doesn't support inline assembly yet... (Or does it? I know it
supports inline Core now.)
Really? I found this in the manual so I think either the docs need to
be updated or you are mistaken:
On 10/06/2011, at 12:12 AM, Dominique Devriese wrote:
Note that the more recent C++ concepts are related to (and inspired
by?) Haskell type classes. See Bernardy et al.'s interesting paper A
comparison of c++ concepts and haskell type classes:
http://portal.acm.org/citation.cfm?id=1411324
Something like this?
equivalenceClosure = fix $ \f e -
let e' = reflexivity . symmetry . transitivity $ e
in if e' == e then e else f e'
Cheers,
--
Felipe.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Henning Thielemann lemming at henning-thielemann.de writes:
On Thu, 9 Jun 2011, Jacek Generowicz wrote:
On 2011 Jun 9, at 16:59, Chris Smith wrote:
Ae you looking to do this in a web application, or client-side? Since one
of your requirements is to display a typeset equation, that makes a
On 9 Jun 2011, at 17:01, Brandon Allbery wrote:
On Thu, Jun 9, 2011 at 07:40, Neil Davies semanticphilosop...@gmail.com
wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
File descriptors/file handles are per process, not
On Thu, Jun 9, 2011 at 23:59, Richard O'Keefe o...@cs.otago.ac.nz wrote:
I understood the OP's question to mean does Haskell allow rebinding
of what _it_ calls standard input, which would be YES for Pop, Ada,
Prolog, and Lisp, just as it is NO for C.
But none of those are Haskell, and neither
Hi all,
Is anyone in the Haskell community doing web development using
delimited continuations? Oleg had a talk on it [1] using Ocaml and CGI
but I haven't heard of anyone taking it further.
-deech
[1]http://okmij.org/ftp/continuations/index.html#shift-cgi
On 10/06/2011, at 4:12 PM, Brandon Allbery wrote:
On Thu, Jun 9, 2011 at 23:59, Richard O'Keefe o...@cs.otago.ac.nz wrote:
I understood the OP's question to mean does Haskell allow rebinding
of what _it_ calls standard input, which would be YES for Pop, Ada,
Prolog, and Lisp, just as it is
On 10/06/2011, at 1:11 AM, Erik Hesselink wrote:
On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com
wrote:
Anyone out there got an elegant solution to being able to fork a haskell
thread and replace its 'stdin' ?
If you don't mind being tied to GHC you can use
On 10/06/2011, at 1:24 AM, James Cook wrote:
On Jun 8, 2011, at 11:17 PM, Gregory Guthrie wrote:
I rather had the feeling expressed by Robert Harper:
Once you're in the IO monad, you're stuck there forever, and are reduced
to Algol-style imperative programming.
Hi All,
Currently debian stable installs ghc 6.12.1.
I'd like to use the latest version of repa which is built on ghc 7.0, and my
attempts to placate cabal's complaints about the installation of various
packages isn't going anywhere.
It's not obvious to me that there's an advantage to using
63 matches
Mail list logo