* Merijn Verstraaten mer...@inconsistent.nl [2013-06-15 22:05:52+0100]
2) for some reason the type families syntax always requires a full
argument list, which I find rather ugly. I would much prefer to use
KindSignatures and write type family Restrict :: * - [*] -
Constraint, but GHC
Hello fellow haskellers!
I was experimenting with restricting functions operating on GADTs with phantom
types to only work on a subset of the possible phantom types. I ended up with
the following code:
{-# LANGUAGE ConstraintKinds, DataKinds, GADTs, TypeFamilies, TypeOperators #-}
import
s (tail l)) n (i + 1)
My question: With the way Haskell works (thunks, lazy evaluation, and
all that mystery), is it actually worth the trouble of /precalculating/
the maximum row values and minimum column values, to compare cell values
against? Or will, for example, something like
, the row maximum and the column
minimum. From there its a trivial filter to find your results. (I'm sure there's
a more elegant solution).
My question: With the way Haskell works (thunks, lazy evaluation, and
all that mystery), is it actually worth the trouble of /precalculating/
the maximum row
On 06/15/2013 04:39 PM, Tommy Thorn wrote:
There's not enough context to answer the specific question,
but lazy evaluation isn't magic and the answer is probably no.
Tommy
Perhaps to simplify the question somewhat with a simpler example.
Suppose you have
code:
let f x = if (x
On 06/15/2013 05:02 PM, Christopher Howard wrote:
On 06/15/2013 04:39 PM, Tommy Thorn wrote:
Perhaps to simplify the question somewhat with a simpler example.
Suppose you have
code:
let f x = if (x 4) then f 0 else (sin x + 2 * cos x) : f (x + 1)
After calculating
Yes. In general, GHC won't CSE for you.
- Clark
On Saturday, June 15, 2013, Christopher Howard wrote:
On 06/15/2013 04:39 PM, Tommy Thorn wrote:
There's not enough context to answer the specific question,
but lazy evaluation isn't magic and the answer is probably no.
Tommy
There's a very good StackOverflow question which covers this: When is
memoization automatic in GHC?[1]. I found it really cleared up the issue
for me.
[1]:
http://stackoverflow.com/questions/3951012/when-is-memoization-automatic-in-ghc-haskell
On Sat, Jun 15, 2013 at 9:13 PM, Clark Gaebel cgae
Ah, so is the idea, then, to use *op()* when `n` wasn't actually
constructed formally, but rather assembled by the user, so as to match
the type of the accessor function normally supplied as the argument to the
constructor?
On 6/7/2013 4:51 PM, Tom Ellis wrote:
On Fri, Jun 07, 2013 at
Hi All,
Referring to the following, which is taken from the *Control.Newtype
*documentation
page:
op ::
Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype
n
o = (o - n) - n -
* David Banas capn.fre...@gmail.com [2013-06-07 07:08:19-0700]
Hi All,
Referring to the following, which is taken from the *Control.Newtype
*documentation
page:
op ::
Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype
n
o = (o - n) -
On Fri, Jun 07, 2013 at 07:08:19AM -0700, David Banas wrote:
op ::
Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype
n
o = (o - n) - n -
oSourcehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/src/Control-Newtype.html#op
The phantom parameter solves the same problem as scoped type variables.
Granted, if you find yourself in that kind of polymorphic soup you have
deeper problems...
On Jun 7, 2013 2:53 PM, Tom Ellis
tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote:
On Fri, Jun 07, 2013 at 07:08:19AM -0700, David
On Fri, Jun 07, 2013 at 04:05:09PM -0400, Joe Q wrote:
The phantom parameter solves the same problem as scoped type variables.
Granted, if you find yourself in that kind of polymorphic soup you have
deeper problems...
I don't understand this. Scoped type variables are used when you want to
On 6/7/2013 4:51 PM, Tom Ellis wrote:
On Fri, Jun 07, 2013 at 04:05:09PM -0400, Joe Q wrote:
The phantom parameter solves the same problem as scoped type variables.
Granted, if you find yourself in that kind of polymorphic soup you have
deeper problems...
I don't understand this. Scoped type
Thanks Richard, now I have my answers.
Richard Eisenberg wrote:
- The type system of Haskell is based on theoretical work that resolutely
assumes that types of non-* kind are uninhabited. While it is possible to
stretch imagination to allow types like 'Zero to be inhabited, the
designers of
Thanks Richard for your detailed answer.
Please find my reply below (note I have rearranged some of your paragraphs).
Richard Eisenberg wrote:
* Types at kind other than * do not have any inhabitants -- in fact, some
people would hesitate to call type-like things at kind other than * types!
On Jun 1, 2013, at 8:18 PM, TP wrote:
In other words, bottom can be an inhabitant of a concrete type, not a type
constructor, which I can understand. But a type of kind Nat is a concrete
type, so why bottom cannot be an inhabitant of this type?
We also have the nice maxim that every
On 6/1/13 3:18 PM, TP wrote:
In other words, bottom can be an inhabitant of a concrete type, not a type
constructor, which I can understand. But a type of kind Nat is a concrete
type, so why bottom cannot be an inhabitant of this type?
The technical term is proper type. That is, types are used
Hi all,
Following a discussion on Haskell Cafe some time ago (1), Roman C. wrote:
On the other hand, the type 'Succ 'Zero has kind 'Nat and doesn't have
any inhabitants — only types of kind * do.
Indeed, this is what seems to occur in the following example:
---
{-#
...@haskell.org] On Behalf Of TP
Sent: 31 May 2013 13:58
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] question about singletons
Hi all,
Following a discussion on Haskell Cafe some time ago (1), Roman C. wrote:
On the other hand, the type 'Succ 'Zero has kind 'Nat and doesn't have any
* TP paratribulati...@free.fr [2013-05-23 00:34:57+0200]
Hi,
In the program I am trying to write, I have a problem that can be reduced to
the following dummy example:
--
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-#
- Person c
Thanks a lot. Now I am using FlexibleContexts, and it works correctly (see
code below). I think I have understood the problem.
However, I have still one question. In the code below, I have added data
constructors Child2, Child3 (imagining a world where every people has
three children
:: (PrettyPrint a, PrettyPrint b)
= String - Person a - Person b - Person c
Thanks a lot. Now I am using FlexibleContexts, and it works correctly (see
code below). I think I have understood the problem.
However, I have still one question. In the code below, I have added data
constructors Child2
Hi,
In the program I am trying to write, I have a problem that can be reduced to
the following dummy example:
--
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE IncoherentInstances #-}
Chris Wong wrote:
data Person :: Gender - * where
Dead :: Person Gender -- WHAT DO I PUT HERE
Alive :: { name :: String
, weight :: Float
, father :: Person Gender } - Person Gender
Here's the problem. In the line:
Dead :: Person Gender
you
On 18 May 2013 11:16, TP paratribulati...@free.fr wrote:
snip
However, I have not managed to make the version with forall work.
Below, the
first occurrence of forall is ok, but the three following yield error.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE
Denis Kasak wrote:
Note that all of this would work even without explicit quantification
since you
have already specified that Person accepts an argument of kind Gender. In
other
words, this works as expected:
data Person :: Gender - * where
Dead :: Person a
Alive :: { name ::
Hi everybody,
I have a question about deriving automatically a Show instance when using
GADT.
It works in this situation:
{-# LANGUAGE GADTs #-}
data Male
data Female
data Person gender where
Dead :: Person gender
Alive :: { name :: String
Hi TP,
On 17/05/13 15:32, TP wrote:
| [...]
|
| So I modify my code by removing deriving Show, and adding the line:
|
| instance Show (Person gender)
|
|
| But now, I obtain:
|
| $ runghc test_show.hs
| GHC stack-space overflow: current
Adam Gundry wrote:
[...]
To use standalone deriving, you need to write
deriving instance Show (Person gender)
and everything will work fine. By writing
instance Show (Person gender)
you are instead giving an instance with no methods, and the default
methods in the Show class contain
On Sat, May 18, 2013 at 9:11 AM, TP paratribulati...@free.fr wrote:
So the following version does not work:
[..]
data Person :: Gender - * where
Dead :: Person Gender -- WHAT DO I PUT HERE
Alive :: { name :: String
, weight ::
Francesco Mazzoli f...@mazzo.li writes:
At Fri, 03 May 2013 16:34:28 +0200,
Andreas Abel wrote:
The answer to your question is given in Boehm's theorem, and the answer
is no, as you suspect.
For the untyped lambda-calculus, alpha-equivalence of beta-eta normal
forms is the same
At Sat, 04 May 2013 09:34:01 +0100,
Jon Fairbairn wrote:
α-equivalence on the Böhm trees — normal forms extended to
infinity. I suppose that counts as “some semantics” but its very
direct.
Ah yes, that makes sense. Thanks!
Francesco
___
The answer to your question is given in Boehm's theorem, and the answer
is no, as you suspect.
For the untyped lambda-calculus, alpha-equivalence of beta-eta normal
forms is the same as observational equivalence. Or put the other way
round, two normal forms which are not alpha-equivalent can
At Fri, 03 May 2013 16:34:28 +0200,
Andreas Abel wrote:
The answer to your question is given in Boehm's theorem, and the answer
is no, as you suspect.
For the untyped lambda-calculus, alpha-equivalence of beta-eta normal
forms is the same as observational equivalence. Or put the other way
if it was possible to find a
useful notion of function equality, such that it would be equivalent to
structural equality (aside from just defining it this way), though
obviously we cannot do this in general.
So the question I came up with was:
Can two normalised (i.e. no subterm can be beta or eta reduced) lambda
be equivalent to
structural equality (aside from just defining it this way), though
obviously we cannot do this in general.
So the question I came up with was:
Can two normalised (i.e. no subterm can be beta or eta reduced) lambda
terms be observationally equivalent, but not alpha equivalent
in the same way, and I got to wondering if it was possible to find a
useful notion of function equality, such that it would be equivalent to
structural equality (aside from just defining it this way), though
obviously we cannot do this in general.
So the question I came up with was:
Can two
the question I came up with was:
Can two normalised (i.e. no subterm can be beta or eta reduced) lambda
terms be observationally equivalent, but not alpha equivalent?
By observationally equivalent, I mean A and B are observationally
equivalent if for all lambda terms L: (L A) is equivalent to (L B
.
...
(I guess the question is about untyped lambda calculus.)
I don’t think so, since Ian talked about ‘terminating’ λ-calculus, while
the untyped λ-calculus isn’t... otherwise you can’t normalise and compare.
Besides that, the typed calculi I cited are interesting because they internalise
some notion
Excerpts from Timon Gehr's message of Thu May 02 14:16:45 -0700 2013:
Those are not lambda terms.
Furthermore, if those terms are rewritten to operate on church numerals,
they have the same unique normal form, namely λλλ 3 2 (3 2 1).
The trick is to define the second one as x * 2 (and assume
IIRC, Barendregt'84 monography (The Lambda Calculus: Its Syntax and
Semantics) has a significant part of it devoted to this question.
* Ian Price ianpric...@googlemail.com [2013-05-02 20:47:07+0100]
Hi,
I know this isn't perhaps the best forum for this, but maybe you can
give me some
)...)
holds: the same function will always produce the same output given
definitionally equal arguments.
...
(I guess the question is about untyped lambda calculus.)
I don’t think so, since Ian talked about ‘terminating’ λ-calculus, while
the untyped λ-calculus isn’t...
'terminating' does not occur
On 05/02/2013 11:37 PM, Edward Z. Yang wrote:
Excerpts from Timon Gehr's message of Thu May 02 14:16:45 -0700 2013:
Those are not lambda terms.
Furthermore, if those terms are rewritten to operate on church numerals,
they have the same unique normal form, namely λλλ 3 2 (3 2 1).
The trick is
‘terminating’ λ-calculus, while
the untyped λ-calculus isn’t...
'terminating' does not occur in the original post.
‘normal form’ does, which is what I was referring to.
otherwise you can’t normalise and compare.
...
The terms in question are already normalised.
‘(L A)’ and ‘(L B
Can anyone tell me why I get a type error with testGrad2? What are my options?
Clearly I would like to be able find the gradient of my cost function for
different sets of observations.
Thanks, Dominic.
{-# LANGUAGE NoMonomorphismRestriction #-}
import Numeric.AD
default()
costFn ::
Answering my own question, what I needed was:
testGrad2 :: (Fractional a, Num a) =
(forall s . Mode s = [AD s a]) -
(forall s . Mode s = [[AD s a]]) -
[a] - [a]
testGrad2 ys xss = grad (costFn ys xss)
On 23 Apr 2013, at 10:44, Dominic Steinitz domi
And if you are, you may be interested in https://github.com/tommythorn/Reduceron
The underlying topic is a fascinating one. The fact that people ignore is that
silicon cycle time improvements have been fairly modest - perhaps 2-3 orders
of magnitude and we have long been at the point where wire
On Mar 22, 2013 2:58 AM, C K Kashyap ckkash...@gmail.com wrote:
Thanks Eric and Brent,
Even with GADT, it appears that I'd need extra data definitions. I'll go
without GADT then ...
Brent, my use case is not particularly complicated. I am trying to model
the pdf spec - which says that pdf
Brent, my use case is not particularly complicated. I am trying to model the
pdf spec - which says that pdf contains Objects that could of of types
Number, String, Name, Array and Dictionary - while array is list of objects,
the Disctionary is a list of tuples (Name, Object) not (Object,
Thanks Eric and Brent,
Even with GADT, it appears that I'd need extra data definitions. I'll go
without GADT then ...
Brent, my use case is not particularly complicated. I am trying to model
the pdf spec - which says that pdf contains Objects that could of of types
Number, String, Name, Array
On Fri, Mar 08, 2013 at 08:53:15PM -0800, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Furthermore, consider:
[...]
- Does the
Hello, cafe.
I have a big problem using builders, so currently I'm using own
builder based on Nettle one [1].
It uses Strict bytestring to build into and unchecked writes, thus
it's very unsafe, plus other
builders/PutM, developed rapidly so I like to switch to another one.
However I use some
Hi,
I have a situation where I need to define a data type T such that
data T = C1 Int | C2 Char | C3 T
However, I want to enforce a constraint that C3 only allows (C2 Char) and
not (C1 Int). That is
x = C3 (C1 10) -- should not compile - but my above definition will let it
compile
I was
You could use a GADT:
{-# LANGUAGE GADTs #-}
data T a where
C1 :: Int - T Int
C2 :: Char - T Char
C3 :: T Char - T Char
This will allow you to put a C3 in a C3. If you want to prevent that,
just invent some other index, something like:
{-# LANGUAGE GADTs, EmptyDataDecls #-}
data Yes
On Thu, Mar 21, 2013 at 06:18:46PM +0530, C K Kashyap wrote:
Hi,
I have a situation where I need to define a data type T such that
data T = C1 Int | C2 Char | C3 T
However, I want to enforce a constraint that C3 only allows (C2 Char) and
not (C1 Int). That is
If C3 should only be able
OWP wrote:
Ironically, you made an interesting point on how Moore's Law created
the on chip real estate that made specialized machines possible. As
transistor sizing shrinks and die sizes increase, more and more real
estate should now be available for usage. Oddly, what destroyed
If I may ask, I'm not quite sure what O(2^n) and O(1) are?
Besides Moore's Law, digital computing also benefits from mature
tools and expertise for optimizing performance at all levels of the
system: process technology,
fundamental circuits, layout and algorithms. Many engineers are
On Mon, Mar 18, 2013 at 4:31 PM, OWP owpmail...@gmail.com wrote:
If I may ask, I'm not quite sure what O(2^n) and O(1) are?
Just a metaphor using algorithmic complexity, is all.
I'm curious, were not all these built on the foundation of Moore's
Law? Everything Vigoda lists has Moore's Law in
On Mon, Mar 18, 2013 at 4:31 PM, OWP owpmail...@gmail.com wrote:
Let me rephrase that, of course they will survive politically. People
built these tools and if built, they will be use but will they survive
efficiently? In the future, if a particular specialized architecture
is somewhat
On 19/03/2013, at 9:31 AM, OWP wrote:
If I may ask, I'm not quite sure what O(2^n) and O(1) are?
Check any data structures and algorithms textbook.
Reverting to the original topic, THIS is the age of specialised
machines. A lot of the chips out there are not just a CPU but
a SoC (System on a
Ironically, you made an interesting point on how Moore's Law created
the on chip real estate that made specialized machines possible. As
transistor sizing shrinks and die sizes increase, more and more real
estate should now be available for usage. Oddly, what destroyed
specialized machines in
Hi,
I was reading the paper A History of Haskell: being lazy with class (
http://www.haskell.org/haskellwiki/History_of_Haskel) and came on a section
(I 2.1) which briefly explained the work people did on making non-von
Neumann architectures.
It concluded by saying
Much (but not all) of this
On Sun, Mar 17, 2013 at 5:56 PM, OWP owpmail...@gmail.com wrote:
These stock architectures, were they really so good that they out
performed the specialized ones on it's own merits or was this mainly due to
Moore's Law on transistors? In other words, suppose we separate Moore's Law
from the
From my $0.2 experience, if you are planning of having multiple GHC
installation, it would be better to do a fresh install using the
bootstrapped GHC you can find on the website. Roughly I have done this way
(on my Mac and on My EC2 instance):
(inside a ghc bootstrapped folder)
./configure
I don't think so. However, you can install the OS X binaries for ghc 7.6.2
and make that sit just next to your Haskell Platform install. You can even
use your existing cabal-install to install packages for the freshly
installed ghc by doing 'cabal install foo --with-ghc=/path/to/ghc'. Just
watch
On 13-03-08 11:53 PM, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Let a = div 0 0
(or whatever pure but problematic expression you like)
On Fri, Mar 08, 2013 at 08:53:15PM -0800, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
[...]
- Use 'evaluate' when you mean to say, Evaluate this thunk to HNF
before doing
Excerpts from Tom Ellis's message of Sat Mar 09 00:34:41 -0800 2013:
I've never looked at evaluate before but I've just found it's haddock and
given it some thought.
http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#v:evaluate
Since it is
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Furthermore, consider:
- Does the answer change when a = b? In such a case, is 'return $! b'
permissible?
-
Hi,
I have Haskell Platform with GHC[i] 7.4.2 installed on a MacOS system. There's
a problem with the handling of certain Markdown constructs in literate Haskell
(lines starting with '#') that I understand is fixed in 7.6.2.
Therefore, I'd like to be able to update my GHC installation to
Carlo,
Thanks a lot! This looks very promising (though I have to test it for my
purpose more in depth). As you mention, the key seems to be the optionMaybe
combinator. Thanks for pointing to it.
Immanuel
2013/3/5 Carlo Hamalainen carlo.hamalai...@gmail.com
On Mon, Mar 4, 2013 at 1:44 AM,
Maybe this is something you do not even want to use a parser combinator library
for. The package
http://hackage.haskell.org/packages/archive/list-grouping/0.1.1/doc/html/Data-List-Grouping.html
contains a function breakBefore, so you can write
main = do inp - readFile ...
let
Andrey,
Thanks a lot for your effort! I have the same suspect that the lookahead in
the content parser is the problem, but I don't know how to solve it either.
At least the I learned from your code that noneOf is also a quite useful
parser in this context which I have overlooked.
Anyway, if you
On Mon, Mar 4, 2013 at 1:44 AM, Immanuel Normann
immanuel.norm...@googlemail.com wrote:
I am trying to parse a semi structured text with parsec that basically
should identify sections. Each section starts with a headline and has an
unstructured content - that's all.
Here's my attempt:
Hi,
I am trying to parse a semi structured text with parsec that basically
should identify sections. Each section starts with a headline and has an
unstructured content - that's all. For instance, consider the following
example text (inside the dashed lines):
---
top 1:
Immanuel,
Since a heading always starts with a new line (and ends with a colon
followed by a carriage return or just a colon?), I think it might be
useful to first separate the input into lines and then classify them
depending on whether it's a heading or not and reassemble them into the
Andrey,
Thanks for your attempt, but it doesn't seem to work. The easy part is the
headline, but the content makes trouble.
Let me write the code a bit more explicit, so you can copy and paste it:
--
{-# LANGUAGE FlexibleContexts #-}
module Main where
Immanuel,
I tried but I couldn't figure it out. Here's a gist with my attempts and
results so far: https://gist.github.com/achudnov/f3af65f11d5162c73064
There, 'test' uses my attempt at specifying the parser, 'test2' uses
yours. Note that your attempt wouldn't parse multiple sections -- for
that
Hi All,
Say I have a haskell function 'f' that does a forkIO and starts an action
a. I create a DLL of this haskell code and inovke f from C. Can I
expect the a to continue to run once f has returned to C?
Regards,
Kashyap
___
Haskell-Cafe mailing
Just to clarify, here is the sample haskell code that I am using -
{-# LANGUAGE ForeignFunctionInterface #-}
module Glue where
import Foreign.C.String
import qualified Control.Concurrent as CC
funHaskell :: CString - IO Int
funHaskell cstr = do
putStrLn Haskell function called
str -
On Thu, Feb 28, 2013 at 6:09 AM, C K Kashyap ckkash...@gmail.com wrote:
Say I have a haskell function 'f' that does a forkIO and starts an action
a. I create a DLL of this haskell code and inovke f from C. Can I
expect the a to continue to run once f has returned to C?
While you're off in C
Quoth C K Kashyap ckkash...@gmail.com,
...
Say I have a haskell function 'f' that does a forkIO and starts an action
a. I create a DLL of this haskell code and inovke f from C. Can I
expect the a to continue to run once f has returned to C?
Once control returns to f's caller, outside of the
Hey Donn .. thanks, it turns out that threads do resume!!! This is how
I got my gmail stuff working.
I only have a doubt if the TCP keep/alive stuff continues to happen or
not
Regards,
Kashyap
On Thu, Feb 28, 2013 at 9:07 PM, Donn Cave d...@avvanta.com wrote:
Quoth C K Kashyap
On 13-02-21 05:18 AM, Doaitse Swierstra wrote:
I ran into the problem that for the packages which I install using
cabal install
The generated html does not contain links to the sources. This issue was raised
before in:
I ran into the problem that for the packages which I install using
cabal install
The generated html does not contain links to the sources. This issue was raised
before in:
http://stackoverflow.com/questions/1587635/haddock-for-cabal-installed-modules
I have been looking into the documentation
On 21 February 2013 21:18, Doaitse Swierstra doai...@swierstra.net wrote:
I ran into the problem that for the packages which I install using
cabal install
The generated html does not contain links to the sources. This issue was
raised before in:
I have to agree that reading and maintaining regular expressions can be
challenging :)
On Wed, Feb 13, 2013 at 9:50 PM, Erik de Castro Lopo
mle...@mega-nerd.comwrote:
wren ng thornton wrote:
Regexes are powerful and concise for recognizing regular languages. They
are not, however, very
Just to play devil's advocate:
100% agreed that there are better things to do in Haskell _source code_ than
regexps.
The thing about regexps is that they can be accepted at run time as _data_.
This means, for example, that they can be put in whatever you use for
localisation.
See for
and still love it.) And at some point we have to call
into question the idea of regexes as an embedded DSL when we then turn
around and try to have Perl be a DSL embedded into the regex language.
One of the big things that makes regexes so nice is that they identify
crucial combinators like
this, but it's extremely
baroque, hard to get right, and impossible to maintain. (N.B., I was raised
on Perl and still love it.) And at some point we have to call into question
the idea of regexes as an embedded DSL when we then turn around and try to
have Perl be a DSL embedded into the regex language
was raised
on Perl and still love it.) And at some point we have to call into question
the idea of regexes as an embedded DSL when we then turn around and try to
have Perl be a DSL embedded into the regex language.
One of the big things that makes regexes so nice is that they identify
replacing it.
Date: Tue, 12 Feb 2013 20:32:01 -0800
From: bri...@aracnet.com
To: nicolasb...@gmail.com
CC: bm...@hotmail.com; b...@redivi.com; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] performance question
On Tue, 12 Feb 2013 15:57:37 -0700
Nicolas Bock nicolasb...@gmail.com wrote
On Tue, Feb 12, 2013 at 11:32 PM, bri...@aracnet.com wrote:
actualy native code compiler. Can't regex be done effectively in haskell
? Is it something that can't be done, or is it just such minimal effort to
link to pcre that it's not worth the trouble ?
PCRE is pretty heavily optimized.
Since I have very little experience with Haskell and am not used to
Haskell-think yet, I don't quite understand your statement that regexes are
seen as foreign to Haskell-think. Could you elaborate? What would a more
native solution look like? From what I have learned so far, it seems to
me that
One way in which regexps are foreign to Haskell-think is that, if they
break, they generally break at run-time. This could be ameliorated with
template haskell, but a substantial portion of Haskell coders find that a
smell itself.
On Wed, Feb 13, 2013 at 8:32 AM, Nicolas Bock
On Wed, 2013-02-13 at 08:39 -0800, David Thomas wrote:
One way in which regexps are foreign to Haskell-think is that, if
they
break, they generally break at run-time. This could be ameliorated
with
template haskell
Care to elaborate on the ameliorate using TH part? I figure regexes
would be
Well, this runtime errors are actually type errors. Regexps are actually a DSL,
which is not embedded in Haskell. But it could be. Strings won't work for that,
but something like that would:
filter (match $ a many anyChar .txt) filenames
and this certainly can be produced by TH like that:
On Wed, Feb 13, 2013 at 11:32 AM, Nicolas Bock nicolasb...@gmail.comwrote:
Since I have very little experience with Haskell and am not used to
Haskell-think yet, I don't quite understand your statement that regexes are
seen as foreign to Haskell-think. Could you elaborate? What would a more
101 - 200 of 4551 matches
Mail list logo