[Haskell-cafe] Re: [Haskell] Functional Programming User Group Ghent

2010-02-22 Thread minh thu
[moving to café from haskell] 2010/2/21 Jeroen Janssen : > Dear all, > We are in the progress of starting up a Functional Programming User Group in > Ghent. The basic idea of the group is to have occasional informal meetings > where people can give talks, where we have invited speakers, where we g

Re: [Haskell-cafe] GHC RTS question

2010-02-22 Thread minh thu
2010/2/22 Ivan Miljenovic : > On 22 February 2010 10:55, Lennart Augustsson wrote: >> Supply a fix for the problem, and it will probably get included. >> There has probably been little demand for this feature so far. > > But it is a little bit weird where if you have an application that you > rele

Re: [Haskell-cafe] GPL answers from the SFLC (WAS: Re: ANN: hakyll-0.1)

2010-03-04 Thread minh thu
2010/3/4 Tom Tobin : > After politely pestering them again, I finally heard back from the > Software Freedom Law Center regarding our GPL questions (quoted > below). > > I exchanged several emails to clarify the particular issues; in short, > the answers are "No", "No", "N/A", and "N/A". The SFLC

Re: [Haskell-cafe] Re: GPL answers from the SFLC

2010-03-04 Thread minh thu
2010/3/4 Stefan Monnier : >> The next question that comes to mind is thus: >> What if a new library X' released under BSD or MIT license implements >> the X API (making possible to compile Y against it)? Can such a new >> library X' be licensed under something else than the GPL (we guess Yes >> bec

Re: [Haskell-cafe] GPL answers from the SFLC (WAS: Re: ANN: hakyll-0.1)

2010-03-05 Thread minh thu
2010/3/5 Magnus Therning : > On Thu, Mar 4, 2010 at 18:05, Stephen Tetley wrote: >> Hi Tom >> >> Hmm, its seems I'm due to eat my hat... >> >> To me though, the judgement makes that insistence that using an API is >> making a derivative work. I can't see how that squares up. > > That has, AFAIU, b

Re: [Haskell-cafe] Implementation of Functional Languages - a tutorial

2010-03-31 Thread minh thu
2010/3/31 C K Kashyap : > Hi Everybody, > I've started reading SPJ's book - When I tried to execute some sample code > in miranda, I found that Miranda does not seem to recognize things like > import Utils > or > module Langauge where ... > Has someone created a clean compilable miranda source out

Re: [Haskell-cafe] Problem about pattern matching.

2010-04-28 Thread minh thu
2010/4/28 Magicloud Magiclouds : > Hi, I have code as below. How come "case" version works wrong and > gives me "overlap" compiling warning? Thanks. >  if dayOfMonth == firstDayOfMonth >    then v day (x, y) >    else if dayOfMonth == lastDayOfMonth >      then not_ $ v day (x, y) >      else Mider

Re: [Haskell-cafe] Haskell Weekly News?

2010-04-28 Thread minh thu
2010/4/28 Ivan Lazar Miljenovic : > Joe Fredette writes: >> That said, if any of you have time machines/time dilation devices in >> the works, I'm happy to beta test. > > Don't be silly, you don't need more time, you need more _you_ > (i.e. clones); after all, nothing ever goes wrong with clones!

Re: [Haskell-cafe] Haskell Weekly News?

2010-04-28 Thread minh thu
2010/4/28 Ivan Lazar Miljenovic : > minh thu writes: > >> 2010/4/28 Ivan Lazar Miljenovic : >>> Joe Fredette writes: >>>> That said, if any of you have time machines/time dilation devices in >>>> the works, I'm happy to beta test. >>>

Re: [Haskell-cafe] Problem about pattern matching.

2010-04-29 Thread minh thu
. > The problem here is, ghc warned me that "_" and "lastDayOfMonth" was > overlapped. And the results showed that, everything that should be > worked with "Mider" was done by "not_ ...". > > On Thu, Apr 29, 2010 at 1:51 AM, Henning Thielemann

Re: [Haskell-cafe] Haskell and scripting

2010-05-03 Thread minh thu
Hi, You can take the xmonad approach: the configuration file is written in Haskell and compiled, so no need for another language. Cheers, Thu 2010/5/3 Martin Erwig : > One of my students has worked on scripting approach in Haskell: > >        http://web.engr.oregonstate.edu/~erwig/papers/abstrac

Re: [Haskell-cafe] Haskell and scripting

2010-05-04 Thread minh thu
2010/5/4 Limestraël : > ... > > Minh, Kyle, Gwern, the dyre approach seems to be very interesting too. > But if I understood well, we also have to recompile at run-time the > configuration haskell script? > So the final application (Yi, for instance) will need GHC to be installed to > run? Or did I

Re: [Haskell-cafe] wxHaskell not in scope

2009-04-16 Thread minh thu
Hi, you can use http://hpaste.org/ to overcome this problem. Cheers, Thu 2009/4/17 Tsunkiet Man : > PS: if the indents are wrong, that's because of gmail copy and past, Im so > sorry. > > 2009/4/17 Tsunkiet Man >> >> Hello, >> >> what you suggested worked! Im very happy with it. However another

Re: [Haskell-cafe] Parsec question

2009-04-16 Thread minh thu
2009/4/17 Michael P Mossey : > I want to write a parser that can read a file with this format: the file has > sections which are demarcated by keywords. Keywords always begin with two > forward slashes and consist of letters, digits, and underscore. The text can > be anything, including special cha

Re: [Haskell-cafe] Parsec question

2009-04-17 Thread minh thu
t;keyword"," more text") > > On "some text//keyword more text" > > this gives the error "expecting //" > > I wonder how I can get the manyTill to be happy with eof before finding the > //? I tried > > parseText = manyTill anyChar (try (strin

Re: [Haskell-cafe] How to understand the fmap here ?

2009-05-05 Thread minh thu
2009/5/5 z_axis : > The following code snippets is from xmonad: > -- Given a window, find the screen it is located on, and compute > -- the geometry of that window wrt. that screen. > floatLocation :: Window -> X (ScreenId, W.RationalRect) > --... > rr <- snd `fmap` floatLocation w > > Prelude>

Re: [Haskell-cafe] List comprehension

2009-05-05 Thread minh thu
2009/5/5 applebiz89 : > > Hi, I think I need to use a list comprehension for this function but Im not > good with list comprehension. this is what I have so at the moment? > > filmsInGivenYear :: Int -> [Film] -> [String] > filmsInGivenYear filmYear ?= [ title | year <- (Film title director year >

Re: [Haskell-cafe] Performance counters

2009-05-05 Thread minh thu
2009/5/5 Andrew Coppin : > Magnus Therning wrote: >> >> Andrew Coppin wrote: >>> >>> Stuff like "how many times does this function get called? How what's the >>> maximum depth it recurses to?" That kind of thing. >> >> It won't help you, but wouldn't it be the kind of thing that'd fit in the >> GHC

Re: [Haskell-cafe] Writing a compiler in Hakell

2009-05-05 Thread minh thu
2009/5/6 Rouan van Dalen : > > Hi everyone. > > I am designing my own programming language. > > I would like to know what is the best way to go about writing my compiler in > haskell. > What are the tools available in haskell that can help with compiler > construction? > > I know about Happy. Is

Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread minh thu
2009/5/13 Robert Wills : > The only web-oriented frp framework that I know of is Flapjax > http://www.flapjax-lang.org/ > > Flapjax is javascript so possibly there could be a way to integrate it > into Haskell using HJavascript? Maybe it could even be integrated > into Happstack? > > I'm also qui

Re: [Haskell-cafe] Problem with Data.Map

2009-06-08 Thread minh thu
Hi, > import Blurp bring every thing defined in the Blurp module in scope. So if blah is defined in blurp, > blah will work as expected. > import qualified Blurp as B does the same thing but everything defined in Blurp should be qualified (i.e. prefixed) with B. > B.blah will work, not > blah So

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: testrunner-0.9

2009-06-11 Thread minh thu
Hi, Have a look at http://projects.haskell.org/testrunner/using-testrunner.html, specifically the last paragraph. Also, http://batterseapower.github.com/test-framework/ says results are reported in deterministic order... Cheers, Thu 2009/6/11 Rodney Price : > When I run Example.lhs for test-fra

Re: [Haskell-cafe] Documentation on hackage

2009-06-15 Thread minh thu
2009/6/15 Uwe Schmidt : > Dear Haskellers, > > who needs this kind of documentation? > > http://hackage.haskell.org/packages/archive/tfp/0.2/doc/html/Types-Data-Num-Decimal-Literals.html > > isn't this a kind of spam? Hi, This is Template Haskell generated code... Cheers, Thu ___

Re: [Haskell-cafe] Which windowing toolkit to use?

2009-06-17 Thread minh thu
2009/6/17 Magnus Therning : > 2009/6/17 Alberto G. Corona : >> Web - HTML > > I'd agree with that. It would be really nice for X-platform. Maybe > it's possible to use JQuery (or Flapjax) to get some nice > dynamic/interacitivity? Does someone know if it possible to make an application which emb

Re: [Haskell-cafe] Re: (fwd) Haskell logo fail

2009-06-18 Thread minh thu
2009/6/18 Jon Fairbairn : > Jason Dusek writes: > >> Why don't we have a picture of a cool dinosaur instead? > > Something cool because the last heat of life went out of it > 65 million years ago? "made with secret dinosaur technology" Thu ___ Haskel

Re: [Haskell-cafe] Parsing .dot files?

2009-06-23 Thread minh thu
2009/6/24 Lee Pike : > Hi, > > Does anybody know of a Haskell library for parsing .dot graph files? (I > know Andy Gill wrote dotgen for *generating* .dot files > .) Hi, You might be interested in http://hackage.haskell.org/package/graphviz. Cheers, Th

Re: [Haskell-cafe] How to read safely?

2009-06-24 Thread minh thu
2009/6/24 Magicloud Magiclouds : > Hi, > Read often throws runtime errors, which breaks the robust of the > problem. How to deal with it? Without lost too much proformance (so > reads is a no). Hi, You might be interested in http://hackage.haskell.org/packages/archive/safe/0.2/doc/html/Safe.html

Re: [Haskell-cafe] Using unsafePerformIO safely

2009-06-25 Thread minh thu
2009/6/25 Hector Guilarte : > > > On Fri, Jun 26, 2009 at 12:58 AM, Brandon S. Allbery KF8NH > wrote: >> >> On Jun 26, 2009, at 00:43 , Hector Guilarte wrote: >> >> Thanks! Actually, if I understood well what you proposed, that's how I >> first tought of doing it, but with a [Maybe String] and on

Re: [Haskell-cafe] Reflections on Haskell and ICFP Contest 2009

2009-06-29 Thread minh thu
Hi Rafael, 2009/6/29 Rafael Gustavo da Cunha Pereira Pinto : > > Hi All, > > As the ICFP 2009 contest (http://www.icfpcontest.org) approaches its end, I > decided to write down some thoughts I had while trying. > > On Friday I downloaded the task (http://www.icfpcontest.org/task-1.9.pdf), > read i

Re: [Haskell-cafe] [: Where the bracket things are? :]

2009-06-30 Thread minh thu
But it won't help to get the knowledge of GHC's internal he was after... Thu 2009/6/29 Robert Greayer : > You can use QuasiQuotation, where your bracketing syntax looks like: > > [$foo| blah blah blah |] > > and 'foo' represents a quasi-quoter, and the stuff inside the brackets > is any arbitrary

Re: [Haskell-cafe] 6.12.1 planning

2009-06-30 Thread minh thu
2009/6/30 Simon Marlow : > Hi Folks, > > As usual, we're planning a major release of GHC around September. Here's our > list of the main items currently scheduled for 6.12.1, and their status. If > you have the time and inclination to help with any of these, please get > involved! > > * Parallel p

Re: [Haskell-cafe] Optimizing Compiler for the ICFP 09 contest's VM

2009-07-04 Thread minh thu
2009/7/4 Matthias Görgens : > The byte code for the virtual machine of this years ICFP specified a > language with single assignment per simulation step. Interestingly > most memory locations get overwritten each simulation step before they > are read. That means, those locations don't have to be

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-09 Thread minh thu
2009/7/9 : > Hi, > > i find the current www.haskell.org frontpage quite overwhelming. > > Compare it for example with the home pages of other programming languages : > http://caml.inria.fr/ > http://factorcode.org/ > http://sbcl.sourceforge.net/ > http://www.ruby-lang.org/en/ > http://www.falconpl

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-09 Thread minh thu
2009/7/9 : >> I find it very to the point and not overwhelming at all : it's easy to > glance over it and find quickly what I want. > > Thanks for your feedback. > > Most people feel overwhelmed when confronted with more than 7+-2 items: > http://www.smashingmagazine.com/2007/10/09/30-usability-is

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-09 Thread minh thu
2009/7/9 Don Stewart : > ttencate: >> Are there any kind of hard statistics and analytics that we can base >> this discussion upon? There is always room for improvement, but >> stumbling around in the dark making blind guesses may not be the best >> way to go. Although I personally feel that Lenny'

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-10 Thread minh thu
2009/7/10 Thomas Davie : > > On 9 Jul 2009, at 18:32, Thomas ten Cate wrote: > >> Are there any kind of hard statistics and analytics that we can base >> this discussion upon? There is always room for improvement, but >> stumbling around in the dark making blind guesses may not be the best >> way t

Re: [Haskell-cafe] Pattern matching does not work like this?

2009-07-15 Thread minh thu
2009/7/15 Magicloud Magiclouds : > Hi, > I do not notice this before. "fun ([0, 1] ++ xs) = .." in my code > could not be compiled, parse error. ++ is a function; you can't pattern-match on that. Cheers, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] Pattern matching does not work like this?

2009-07-15 Thread minh thu
2009/7/15 minh thu : > 2009/7/15 Magicloud Magiclouds : >> Hi, >> I do not notice this before. "fun ([0, 1] ++ xs) = .." in my code >> could not be compiled, parse error. > > ++ is a function; you can't pattern-match on tha

Re: [Haskell-cafe] [Haskell Cafe] Data construction: how to avoid boilerplate code?

2009-07-30 Thread minh thu
2009/7/29 Luke Palmer : > On Wed, Jul 29, 2009 at 10:15 AM, Paul Sujkov wrote: >> Hi Luke, >> >> I'm not pretty sure. The thing I don't like is the need to copy-and-paste >> all the code with enumeration constructors. So, now I have two types to make >> Type data from, but they could be many, so I'

[Haskell-cafe] Coercion from a Word32/64 to a Float/Double

2009-09-14 Thread minh thu
Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader -> Get Float getFloat h = case endianness h of LittleEndian -> fmap (coerce . fromIntegral) getWord32le BigEndian -> fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) --

Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double

2009-09-14 Thread minh thu
h. Cheers, Thu 2009/9/14 John Millikin : > If you don't mind a small performance penalty, have you considered > using my library data-binary-ieee754? It contains functions for > parsing floats and doubles within the Get monad. > > On Mon, Sep 14, 2009 at 12:24, minh thu wrote: &g

Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double

2009-09-14 Thread minh thu
2009/9/14 Judah Jacobson : > On Mon, Sep 14, 2009 at 12:24 PM, minh thu wrote: >> Hi, >> >> I'd like to know if this should work: >> >> -- GHC coercion >> getFloat :: BHeader -> Get Float >> getFloat h = >> case endianness h of >

Re: [Haskell-cafe] Parallel graphics

2009-09-15 Thread minh thu
Hi Andrew, 2009/9/15 Andrew Coppin : > ... > I'm presuming that sparking every individual point is going to create > billions of absolutely tiny sparks, which probably won't give great > performance. We could spark every line rather than every point? > ... You should just try: no one can say if p

Re: [Haskell-cafe] (weird stuff) Kernel Modules in Haskell ;-)

2009-09-15 Thread minh thu
2009/9/15 Matthias Kilian : > A fellow openbsd developer told me the URL below... > > I hope this hasn't been posted on this list already (at least I > didn't find it in my local archives): > > http://tommd.wordpress.com/2009/09/13/kernel-modules-in-haskell/ I don't think it was posted here, but i

Re: [Haskell-cafe] Re: Calling Lockheed, Indra, Thales, Raytheon

2008-08-30 Thread minh thu
2008/8/30 Ashley Yakeley <[EMAIL PROTECTED]>: > Paul Johnson wrote: >> >> This is a strange question, I know, but is there anyone working in any of >> the above companies on this mailing list? >> >> Everyone will no doubt be wondering what they have in common. I'm afraid >> I can't discuss that. >

[Haskell-cafe] cabal update : getHostByName

2008-09-01 Thread minh thu
Hi, I've followed the instruction from the upcoming book Real World Haskell to install cabal. Now, when I enter "cabal update", it answers this: Downloading package list from server 'http://hackage.haskell.org/packages/archive' cabal: getHostByName: does not exist (no such host entry) What's th

Re: [Haskell-cafe] cabal update : getHostByName

2008-09-01 Thread minh thu
2008/9/1 Marc Weber <[EMAIL PROTECTED]>: > On Mon, Sep 01, 2008 at 12:01:49PM +0200, minh thu wrote: >> Hi, >> >> I've followed the instruction from the upcoming book Real World >> Haskell to install cabal. >> >> Now, when I enter "cabal u

Re: [Haskell-cafe] Re: cabal update : getHostByName

2008-09-01 Thread minh thu
2008/9/1 PéterDiviánszky <[EMAIL PROTECTED]>: > Hi, > >> Now, when I enter "cabal update", it answers this: >> >> Downloading package list from server >> 'http://hackage.haskell.org/packages/archive' >> cabal: getHostByName: does not exist (no such host entry) > > I received the same error message.

[Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-03 Thread minh thu
Hi, I'd like to write a data structure to be used inside the IO monad. The structure has some handles of type Maybe (IORef a), i.e. IORef are pointers and the Maybe is like null pointers. So I came up with the following functions : readHandle :: Maybe (IORef a) -> IO (Maybe a) readField :: (a ->

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-03 Thread minh thu
2008/9/3 Bulat Ziganshin <[EMAIL PROTECTED]>: > Hello minh, > > Wednesday, September 3, 2008, 2:09:38 PM, you wrote: > >> I'd like to write a data structure to be used inside the IO monad. >> The structure has some handles of type Maybe (IORef a), >> i.e. IORef are pointers and the Maybe is like nu

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-03 Thread minh thu
2008/9/3 Lennart Augustsson <[EMAIL PROTECTED]>: > I think you should think about why your application needs IORef at all. Do > you really need mutation? And why isn't STRef good enough. Using IORef is > really the last resort. This is for an interactive application (3D mesh editing, the data str

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
ow > you're doing things or, if you cannot translate the concepts to a functional > form, using an imperative language. Overall, I agree I have to look for a more pure approach. Although, I think something like FGL required a lot of work. But raising, say, uvector, in face of my use of IO

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
o you know in favor of what ? FGL uses its own Data.Graph.Inductive.Internal.FiniteMap, saying Data.FiniteMap is not enough. Should it use Data.Map ? Thanks for the suggestion, Thu > -- Lennart > > On Thu, Sep 4, 2008 at 8:53 AM, minh thu <[EMAIL PROTECTED]> wrote: >> 2008/9/4

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
2008/9/4 Paul Johnson <[EMAIL PROTECTED]>: > minh thu wrote: >> >> Do you suggest I use >> >> data Thing = Thing | None >> >> and IORef Thing instead of >> >> data Thing = Thing >> >> and Maybe (IORef Thing) ? >> >> I

[Haskell-cafe] monadic map on a Data.IntMap

2008-09-08 Thread minh thu
Hi, Is there something like a fmapM_ ? In particular, I'd like to mapM_ a Data.IntMap instead of a List Thank you, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] monadic map on a Data.IntMap

2008-09-08 Thread minh thu
2008/9/8 Jefferson Heard <[EMAIL PROTECTED]>: > I suppose a > > mapM_ monadicFunction . Data.IntMap.toList $ m > > doesn't work for you? Well, that's what I use (IntMap.elems in fact), but isn't there some perfromance lost ? Thu > > On Mon, Sep 8, 2

Re: [Haskell-cafe] Library design question

2008-09-18 Thread minh thu
2008/9/18 Andre Nathan <[EMAIL PROTECTED]>: > Hello > > I'm trying to write a simple graph library for a project of mine > (actually, I'm porting it from OCaml) but I've got a design question > right in the beginning. > > My Graph type is the following. > > data Graph a b = Graph >{ adjacencie

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread minh thu
2008/9/18 Evan Laforge <[EMAIL PROTECTED]>: >> All of this works of course because in Haskell, "=" is not an assignment, >> it's a definition, and the RHS is not a variable, it's a pattern. And "4" is >> a perfectly legitimate pattern. Now, if only I could find a use for all this >> that borders on

[Haskell-cafe] Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
Hi, I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html Should I use loadIdentity then multMatrix instead ? Thank you, Thu ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
2008/9/25 Achim Schneider <[EMAIL PROTECTED]>: > "minh thu" <[EMAIL PROTECTED]> wrote: > >> I can't find the loadMatrix function in >> http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html &g

Re: [Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
2008/9/25 Bit Connor <[EMAIL PROTECTED]>: > withMatrix doesn't seem to have anything to do with glLoadMatrix. > > You are right that you can do glLoadMatrix with loadIdentity and multMatrix. > > To directly load a matrix, use the function "matrix" (with a Nothing > argument). This will internally c

Re: [Haskell-cafe] Haskell versus F#, OCaml, et. al. ...

2008-09-30 Thread minh thu
2008/9/30 Galchin, Vasili <[EMAIL PROTECTED]>: > > thanks .. ... just trying to get an objective viewpoint and see where the > "holes" are ... > [...] > On Tue, Sep 30, 2008 at 1:46 AM, Don Stewart <[EMAIL PROTECTED]> wrote: >> [...] >> Without more information, all we can really do is an overview.

Re: [Haskell-cafe] state monad and continuation monads ...

2008-09-30 Thread minh thu
2008/9/30 Galchin, Vasili <[EMAIL PROTECTED]>: > Hello, > >I would like to read > > 1) pedagogical examples of State monad and the Continuation monad > > 2) library usage of these monads Regarding 1), there is a lot to find on the web. Maybe start on haskell.org. In term of examp

[Haskell-cafe] postmortem question about xmonad

2008-09-30 Thread minh thu
Hi, I'd like to know, now that time got by a bit, what the writers of the X monad think about the use of the ReaderT/WriterT/IO brought to them (to isolate Configuration data and dynamic data and glue them together with IO). Are you happy of it, did it make things easier or not, would you do it ag

Re: [Haskell-cafe] postmortem question about xmonad

2008-10-01 Thread minh thu
2008/10/1 Jason Dagit <[EMAIL PROTECTED]>: > > > On Tue, Sep 30, 2008 at 1:20 PM, Don Stewart <[EMAIL PROTECTED]> wrote: >> >> noteed: >> > Hi, >> > >> > I'd like to know, now that time got by a bit, what the writers of the >> > X monad think about the use of the ReaderT/WriterT/IO brought to them

Re: [Haskell-cafe] Re: Announcing OneTuple-0.1.0

2008-10-02 Thread minh thu
2008/10/2 Jon Fairbairn <[EMAIL PROTECTED]>: > Benjamin L.Russell <[EMAIL PROTECTED]> writes: > >>>Note: the singleton tuple does not support tuple syntax. >> >> What is the syntax for the singleton tuple? [...] >> the singleton syntax will be different from the non-singleton syntax, >> which is a

Re: [Haskell-cafe] A question about constraints

2008-10-02 Thread minh thu
2008/10/2 jean-christophe mincke <[EMAIL PROTECTED]>: > Hello, > > Given a type T, this type identifies a set of values and this set can be > deduced from the structure of type T. > > i.e the type String is the set of all possible lists of character whatever > their length. > > This being said, I

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread minh thu
ink the need for singleton tuples is rare enough that the > syntactic inconsistency is tolerable. > > Jon Fairbairn suggests using unicode 0x27e8 and 0x27e0 in place of > parentheses for tuples. I like the idea, especially as an alternate > syntax for the same tuple types, permitting the

Re: [Haskell-cafe] Is Haskell-Cafe down?

2008-10-03 Thread minh thu
2008/10/3 Benjamin L. Russell <[EMAIL PROTECTED]>: > About two hours ago, I sent two follow-ups to the "Announcing > OneTuple-0.1.0" thread on the Haskell-Cafe mailing list, neither of > which has appeared in either my newsreader or my Inbox, even though > they have both appeared on the Web archive

Re: [Haskell-cafe] Hmm, what license to use?

2008-10-03 Thread minh thu
2008/10/3 Mitchell, Neil <[EMAIL PROTECTED]>: > > Hi > > >> > > You mean shared libraries without the opportunity to >> inline library code? >> > > This would result in a huge performance loss, I think. >> > >> > Usually _mild_ performance loss, in exchange for major code-size >> > savings, I would

[Haskell-cafe] Typeable and Dynamic

2008-11-03 Thread minh thu
Hi, Given a TypeRep and a Dynamic value with type corresponding to the TypeRep, I'd like to be able to use fromDyn *without* specifying a type (given as an additional 'default' argument) (since it is somewhat known from the TypeRep). That is, I'd like an undefinedOf that can be used in extract :

Re: [Haskell-cafe] Typeable and Dynamic

2008-11-03 Thread minh thu
2008/11/4, Antoine Latter <[EMAIL PROTECTED]>: > On Mon, Nov 3, 2008 at 4:58 PM, minh thu <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Given a TypeRep and a Dynamic value with type corresponding to the > > TypeRep, I'd like to be able to use fromDyn

[Haskell-cafe] Re: Typeable and Dynamic

2008-11-04 Thread minh thu
2008/11/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > minh thu asked a tricky question, about writing > > extract :: Typeable a => TypeRep -> Dynamic -> a > > The question here is what determines the type 'a'. One answer is that > 'a' is det

Re: [Haskell-cafe] Re: Time for a new logo?

2008-12-17 Thread minh thu
2008/12/17 Neal Alexander : > m...@justinbogner.com wrote: >> >> George Pollard writes: >>> >>> On Wed, 2008-12-17 at 02:47 +, Jeff Wheeler wrote: I love this ASCII-art version. I tried to make a vector version of it in Photoshop, and I came up with this [1] and [2]. A

[Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
Hi, I'd like to process some kind of graph data structure, say something like data DS = A [DS] | B DS DS | C. but I want to be able to discover any sharing. Thus, in b = B a a where a = A [C], if I want to malloc a similar data structure, I have to handle to the node representing B two times t

Re: [Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
2009/1/8 Luke Palmer : > On Thu, Jan 8, 2009 at 1:28 AM, minh thu wrote: >> >> Hi, >> >> I'd like to process some kind of graph data structure, >> say something like >> >> data DS = A [DS] | B DS DS | C. >> >> but I want to be able to

Re: [Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
e > it. > > GHC does have a library for stable names which (in the IO monad) > allows you to get something akin to the address of a value in memory. > But that's not the functional way of doing this. > > -- Lennart > > On Thu, Jan 8, 2009 at 9:28 AM, minh thu wrot

Re: [Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
Great, System.Mem.StableName [1] seems to be able to do the trick. Thank you. [1] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-StableName.html 2009/1/8 minh thu : > Well, the processing of the data structure has to be done in the IO monad. > What is the library yo

Re: [Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
nart Augustsson : > Look at > http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-StableName.html. > > But what's wrong with constructing the graph in a monad? > > On Thu, Jan 8, 2009 at 9:53 AM, minh thu wrote: >> Well, the processing of the data struc

Re: [Haskell-cafe] Re: How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
2009/1/8 Ertugrul Soeylemez : > "minh thu" wrote: > >> Nothing, simply the notation. Now, with the remark of Luke, I'm >> wondering how bad it is to use makeStableName/hashStableName to "copy" >> the data structure in a similar one with explicit

Re: [Haskell-cafe] Re: How to give unique name/id to nodes outside any monad ?

2009-01-08 Thread minh thu
Interestingly, I failed to detect sharing with StableName. But using the graph node as a key turned to work... If you're interested in the experiment, see attached code. Cheers, Thu 2009/1/8 minh thu : > 2009/1/8 Ertugrul Soeylemez : >> "minh thu" wrote: >> >>

Re: [Haskell-cafe] How to give unique name/id to nodes outside any monad ?

2009-01-09 Thread minh thu
2009/1/9 Timothy Goddard : > On Thu, 08 Jan 2009 21:28:27 minh thu wrote: >> Hi, >> >> I'd like to process some kind of graph data structure, >> say something like >> >> data DS = A [DS] | B DS DS | C. > > Graphs in funtional languages aren't

Re: [Haskell-cafe] Re: Monads aren't evil

2009-01-11 Thread minh thu
I always thought that instead of having two classes of characters, one for variable (and function) names and the other for operators, only the first charater of the identifier could mean it's one or the others, so *vec or +point would be valid operator names and thus >_> too. And C++ could be a Dat

Re: [Haskell-cafe] Re: Monads aren't evil

2009-01-11 Thread minh thu
2009/1/11 Martijn van Steenbergen : > minh thu wrote: >> >> I always thought that instead of having two classes of characters, one >> for variable (and function) names and the >> other for operators, only the first charater of the identifier could >> mean it&#

[Haskell-cafe] how to link to external documentation with haddock ?

2009-01-11 Thread minh thu
Hi, When generating haddock documention (I use runhaskell Setup.lhs haddock), haddock warns me : "could not find link destinations for:" and lists for instance GHC.Show.Show or Data.Either.Either. Is it possible to instruct Haddock to links against http://www.haskell.org/ghc/docs/latest/html/libr

Re: [Haskell-cafe] Multiple State Monads

2009-01-12 Thread minh thu
2009/1/12 Phil : > Hi, > > I've been reading the Monads aren't evil posts with interest – I'm a 2nd > week Haskell newbie and I'm doing my best to use them where (I hope) it is > appropriate. Typically I'm writing my code out without using Monads > (normally using list recursion), and then when I

Re: [Haskell-cafe] How does one delare a 2D STUArray in Haskell?

2009-09-24 Thread minh thu
2009/9/25 Casey Hawthorne : > How does one delare a 2D STUArray in Haskell? Hi, STUArray, like other arrays is parametrized by the type of the index, the "i" in "STUArray s i e" [1]. That "i" is should be an instance of Ix which is a class of the types that can be used as indices. If you want to

Re: [Haskell-cafe] How does one delare a 2D STUArray in Haskell?

2009-09-25 Thread minh thu
2009/9/25 Casey Hawthorne : > Well that makes sense, but for a learner, how is he/she supposed to > know that 'i' could be '(i,i)' or for that matter a tuple of n of > those i's? > > "STUArray s i e" > > Could you also have a tuple of states? > > Obviosly, 'e' could be a tuple, for instance (Int,C

Re: [Haskell-cafe] How does one delare a 2D STUArray in Haskell?

2009-09-25 Thread minh thu
2009/9/25 minh thu : > 2009/9/25 Casey Hawthorne : >> Well that makes sense, but for a learner, how is he/she supposed to >> know that 'i' could be '(i,i)' or for that matter a tuple of n of >> those i's? >> >> "STUArray s i e" &g

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-28 Thread minh thu
2009/9/28 Casey Hawthorne : > On Mon, 28 Sep 2009 12:06:47 +1300, you wrote: > >> >>On Sep 28, 2009, at 9:40 AM, Olex P wrote: >> >>> Hi, >>> >>> Yes, I mean "sizeOf 2". It's useful not only on GPUs but also in >>> "normal" software. Think of huge data sets in computer graphics >>> (particle clouds

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-10-02 Thread minh thu
2009/10/2 John A. De Goes : > On Oct 1, 2009, at 12:13 AM, Curt Sampson wrote: > >> And as far as something like dealing with a changing language and >> libraries, the mainstream already has well-established and popular >> techniques for doing just: agile development. > > A project manager's worst

Re: [Haskell-cafe] What *is* a DSL?

2009-10-07 Thread minh thu
Hi, Some random observation: A (E)DSL and an API fall on the same plane when they just expose functionality of a library. The difference between EDSL and a DSL is really just the E which means embedded into a host language so the embedded language can be built on top of some existing machinery,

Re: [Haskell-cafe] What *is* a DSL?

2009-10-07 Thread minh thu
2009/10/7 Günther Schmidt : > Hi Don, > >> I've informally argued that a true DSL -- separate from a good API -- >> should have semantic characteristics of a language: binding forms, >> control structures, abstraction, composition. Some have type systems. >> > > That is one requirement that confuse

Re: [Haskell-cafe] Re: What *is* a DSL?

2009-10-07 Thread minh thu
2009/10/7 Ben Franksen : > minh thu wrote: >> 2009/10/7 Günther Schmidt : >>>> I've informally argued that a true DSL -- separate from a good API -- >>>> should have semantic characteristics of a language: binding forms, >>>> control structures

Re: [Haskell-cafe] New to Haskell - List Comprehension Question

2009-10-07 Thread minh thu
2009/10/7 Steven1990 : > > Hi, I'm currently learning Haskell, and I've been trying to work out a > function for the following problem for a couple of days now. > > I want to use a list comprehension method to change the first letter of a > string to upper case, and the rest of the string to lower

[Haskell-cafe] type inference question

2009-10-08 Thread minh thu
Hi, I'd like to know what are the typing rules used in Haskell (98 is ok). Specifically, I'd like to know what makes let i = \x -> x in (i True, i 1) legal, and not let a = 1 in (a + (1 :: Int), a + (1.0 :: Float)) Is it correct that polymorphic functions can be used polymorphically (in multi

Re: [Haskell-cafe] type inference question

2009-10-08 Thread minh thu
2009/10/8 Jochem Berndsen : > minh thu wrote: >> Also, I'd like to know why >> >> id id True >> >> is permitted but not >> >> (\f -> f f True) id > > If you want to do this, answer the question "what is the type of (\f -&

Re: [Haskell-cafe] type inference question

2009-10-08 Thread minh thu
t 8, 2009 at 11:04 AM, minh thu wrote: >>> Hi, >>> >>> I'd like to know what are the typing rules used in Haskell (98 is ok). >>> >>> Specifically, I'd like to know what makes >>> >>> let i = \x -> x in (i True, i 1) >&

Re: [Haskell-cafe] type inference question

2009-10-08 Thread minh thu
2009/10/8 Cristiano Paris : > On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson > wrote: >> The reason a gets a single type is the monomorphism restriction (read >> the report). >> Using NoMonomorphismRestriction your example with a works fine. > > Could you explain why, under NoMonomorphismRest

Re: [Haskell-cafe] type inference question

2009-10-09 Thread minh thu
2009/10/9 wren ng thornton : > Cristiano Paris wrote: >> >> On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson wrote: >>> >>> The reason a gets a single type is the monomorphism restriction (read >>> the report). >>> Using NoMonomorphismRestriction your example with a works fine. >> >> Could you e

  1   2   3   4   >