Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskell -- Useful?

Name: Anonymous 2007-04-25 20:34 ID:yc87I68U

Lately I've been toying with Haskell, but I'm becoming less and less convinced that it's actually useful. Sure, strong static typing is nice and it's very elegant, but... it seems really tricky to do a lot of basic things that are trivial in most imperative languages.

Case in point: I wanted to use haskell to produce a set of permutations of an array I had stored in a .h file like so:

// blah blah blah
some stuff;
some other random bits;

enum blah {
 A = 0,
 B,
 C,
 NUM_BLAH
};

I want to read in the file, then parse bits out until I have an array like ["A","B","C"]. In ruby, it's trivial to hack together a couple of regexes to extract the requisite information, but I couldn't wrap my head around how to do it nicely and quickly in Haskell (without resorting to the complications of Parsec and thereby parsing a subset of C...)

Is Haskell the wrong tool for this sort of work or am I just dumb?

Name: Anonymous 2007-04-25 21:28 ID:h6IHDCsG

Text.Regex.Posix

match on input, print out submatches

Name: Anonymous 2007-04-26 9:30 ID:zzqMIu98

Name: Anonymous 2008-12-29 5:15

EXPERT BBCODE DISPLAYER

[s:[s:dfdf:s]fdsfs:s]

Name: Anonymous 2009-01-14 12:53

LISP

Name: Anonymous 2009-03-06 13:24


The back of napkins like Leonardo da   Vinci did If.

Name: Anonymous 2011-02-03 2:53

Name: Sgt.Kabuꨶ뭁kiman唙 2012-05-29 0:47

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List