[Haskell-cafe] Cabal fail

2011-06-11 Thread Andrew Coppin

How do you make Cabal fail?

Let me clarify. I built a package that uses a post-configure hook to do 
some settings detection. Under certain circumstances, it can fail. When 
this happens, the hook prints fatal error and quits. Unfortunately, I 
didn't actually /test/ whether it works. On further investigation, I 
discovered that the hook considers itself to have failed, but it doesn't 
bother actually telling Cabal about this. (!) So Cabal still thinks 
everything went fine.


OK, so, let's the correct way to notify Cabal that we need to retry the 
configure step? I can't figure it out from the minimal documentation in 
Distribution.Simple. (I'm guessing I need to use a pre-configure hook, 
since by the time post-configure runs, the configure stage is presumably 
over...?)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Lazy lists vs generators

2011-06-11 Thread oleg

Yves Pare`s  wrote:

 I cannot help smiling when I hear Java/C#/Python developers telling about
 the wondeful features of their languages ;)
 (- We have generators! We can _yield_ values! [1]
  - Yeah, so nice... We have simple lists... with lazy evaluation)

Just for the record, lazy lists per se are sufficient only for
simplest generators. Re-writing an accumulating traversal to
accommodate suspension by hand is too ungainly and error prone. Still,
if we just add exceptions (the Either monad), we can idiomatically
write all the generator examples of Python or Icon, for example. If we
do not need effects other than yielding or non-determinism, [Either e a],
which is ErrorT e [] a, suffices. If we need IO or mutable state,
we should replace [] with LogicT (which is the monad of lazy lists
with effect).

The following web page talks about lazy lists and generators 
http://okmij.org/ftp/continuations/generators.html
in (perhaps too) great detail.



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Class and Instance

2011-06-11 Thread Patrick Browne
Thanks for the feedback. I have two further questions
1. Why is it that the Containers class signature does not allow
instances to be list of list? I suspect it is because x is a constructor.
2. How would I change the Containers  class signature to allow instances
to be lists of lists.

Thanks,
Pat

-- x is a type constructor, not a type
class  Containers x y where
 insert :: y - x y - x y
 remove :: y - x y - x y
 whatsIn :: x y - [y]


instance Containers [] Char where
 insert y [] = y:[]
 insert y m  = y:m
 remove _ [] = []
 remove x (y:ys) | x == y= remove x ys
 | otherwise = y : remove x ys
 whatsIn  = id


instance Containers [] Integer where
 insert y [] = y:[]
 insert y m  = y:m
 remove _ [] = []
 remove x (y:ys) | x == y= remove x ys
 | otherwise = y : remove x ys

 whatsIn  = id

-- cannot have containers of containers.
-- instance Containers [] [] where
-- container.hs:41:23:
--`[]' is not applied to enough type arguments
--  Expected kind `*', but `[]' has kind `* - *'
--  In the instance declaration for `Containers [] []'
-- Failed, modules loaded: none.

This message has been scanned for content and viruses by the DIT Information 
Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fixed points

2011-06-11 Thread Max Rabkin
On Fri, Jun 10, 2011 at 21:05, Alexander Solla alex.so...@gmail.com wrote:
 equivalenceClosure :: (Ord a) = Relation a - Relation a
 equivalenceClosure = fix (\f - reflexivity . symmetry . transitivity)

If you want to learn about fix, this won't help you, but if you're
just want the best way to calculate equivalence closures of relations,
then it's probably

equivalenceClosure = transitivity . symmetry . reflexivity

assuming those are the transitive, symmetric and reflexive closure
functions. You still need some kind of iteration to get the transitive
closure. The algorithm I know of for that is Warshall's Algorithm,
which is O(N^3) (possibly with a log N factor for pure data
structures).

--Max

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Lazy lists vs generators

2011-06-11 Thread Jerzy Karczmarczuk

Le 11/06/2011 11:06, o...@okmij.org a écrit :

The following web page talks about lazy lists and generators
http://okmij.org/ftp/continuations/generators.html
in (perhaps too) great detail.

Oleg, when you mention Icon, you might - perhaps - observe that Griswold 
didn't introduce the co-expressions (this is their terminology, not 
generators) out of the air, they have been present as the unevaluated 
expressions in Snobol4. Icon has been built upon the Snobol4 
philosophy, although as language it was very different.


Another remark about yield in Python. This is not just a 
non-deterministic return mechanism, but an expression, which yields a 
value also for the generator code. It becomes thus a reentrant 
co-procedure, which goes quite a mileage beyond the lazy list model.



Jerzy Karczmarczuk


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] How do you test a parser?

2011-06-11 Thread Andrew Coppin
OK, so suppose you sit down and write a complicated string parser. Now 
how do you test that it works correctly?


One way is to run the parser over a large corpus of real world 
samples. This has a number of problems:


* If the parser is for a grammar you just invented yourself, presumably 
no real world corpus exists yet.


* This tests that the most commonly used features work OK, but might not 
test whether more obscure features work right.


* There's no really obvious way to check that what the parser returns is 
/correct/. You've got the input, but there's nothing to compare with.


* This probably doesn't test whether the parser /fails/ for invalid 
input, since a real world corpus would presumably consist entirely of 
valid input.


Most people's library of choice appears to be QuickCheck. But while it's 
not hard to have QuickCheck generate random strings and confirm that the 
returned parse tree (if any) doesn't violate any invariants, it's not so 
easy to check that the parse tree is actually what it should be.


On top of that, depending on what the grammar is, the vast majority of 
random strings are probably just parse failures. Even if they aren't, 
there are probably specific constructs that are special-cased in the 
parser, which are very unlikely to appear by chance. (Things like 
keyword names, special combinations of punctuation, etc.)


You can try to write your own text generator that constructs text more 
closely approximating what your parser is supposed to parse. But then 
how do you tell whether your generator is right?


If you have a function that turns a parse tree back into text again, you 
can try verifying that a round-trip is the identity function. Except 
perhaps sometimes it isn't. Perhaps a given expression has more than one 
equivalent representation. A round-trip from string and back again is 
even less likely to be stable.


So what's the best way to attack this problem?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Vi mode in ghci?

2011-06-11 Thread cheater cheater
readline has keyboard shortcuts to change from emacs mode to vi and a
separate to go back. Find out what they are and check if they work on
haskeline, you got me wondering but i have no ghci access from here.
Definitely easier than editing a config.

Cheers,
D.

On Sat, Jun 11, 2011 at 00:08, Marc Weber marco-owe...@gmx.de wrote:
 You can also get vim-addon-async [1]  and run ghci
 inside Vim. Then you can use all Vim goodness.

 [1]: requires client-server. Tested on Linux and Mac
 http://github.com/MarcWeber/vim-addon-async

 Marc Weber

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Class and Instance

2011-06-11 Thread Daniel Patterson
The problem is that [] alone is not a concrete type - that is what the error is 
saying, that [] needs to be applied to another type to yield a concrete type. 
IE, you need a list of something, not just the idea of a list. That something 
can be polymorphic, so the following works (note the [a]):

class  Containers x y where
  insert :: y - x y - x y
  {-remove :: y - x y - x y
  whatsIn :: x y - [y]-}

instance Containers [] [a] where
  insert x y = x:y
  


On Jun 11, 2011, at 5:49 AM, Patrick Browne wrote:

 Thanks for the feedback. I have two further questions
 1. Why is it that the Containers class signature does not allow
 instances to be list of list? I suspect it is because x is a constructor.
 2. How would I change the Containers  class signature to allow instances
 to be lists of lists.
 
 Thanks,
 Pat
 
 -- x is a type constructor, not a type
 class  Containers x y where
 insert :: y - x y - x y
 remove :: y - x y - x y
 whatsIn :: x y - [y]
 
 
 instance Containers [] Char where
 insert y [] = y:[]
 insert y m  = y:m
 remove _ [] = []
 remove x (y:ys) | x == y= remove x ys
 | otherwise = y : remove x ys
 whatsIn  = id
 
 
 instance Containers [] Integer where
 insert y [] = y:[]
 insert y m  = y:m
 remove _ [] = []
 remove x (y:ys) | x == y= remove x ys
 | otherwise = y : remove x ys
 
 whatsIn  = id
 
 -- cannot have containers of containers.
 -- instance Containers [] [] where
 -- container.hs:41:23:
 --`[]' is not applied to enough type arguments
 --  Expected kind `*', but `[]' has kind `* - *'
 --  In the instance declaration for `Containers [] []'
 -- Failed, modules loaded: none.
 
 This message has been scanned for content and viruses by the DIT Information 
 Services E-Mail Scanning Service, and is believed to be clean. 
 http://www.dit.ie
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread Paul Johnson

On 11/06/11 14:10, Andrew Coppin wrote:
OK, so suppose you sit down and write a complicated string parser. Now 
how do you test that it works correctly?



If you have a function that turns a parse tree back into text again, 
you can try verifying that a round-trip is the identity function. 
Except perhaps sometimes it isn't. Perhaps a given expression has more 
than one equivalent representation. A round-trip from string and back 
again is even less likely to be stable.


So what's the best way to attack this problem?

_


If your parse tree has a show instance (or better yet, a pretty-print 
function) then you can generate random parse trees, print them, and then 
show that the parse returns an equal tree.


However if you want to have useful error messages or a wider range of 
representations than just those generated by show then you will need 
to write a QuickCheck variant on the show function that emits all 
these variations, which is likely to be rather more work.




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] In ML books; functors only consume produce structures; whereas, functions CP values.

2011-06-11 Thread Brent Yorgey
On Fri, Jun 10, 2011 at 07:53:58PM -0700, KC wrote:
 I've never seen such an easy description in Haskell books.
 
 Is there more going on with Haskell functors?

Note that ML functors and Haskell functors are different things.  ML
functors are parameterized modules.  Haskell functors are types which
are instances of the Functor class.  I think 'functor' is a bad name
for the ML concept, but of course I'm somewhat biased.

-Brent

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] GHC7 build problem

2011-06-11 Thread Scott Lawrence
Trying to compile GHC7 from source (as the ubuntu repository is still on
GHC6), I came across the following error in the final phase:

libraries/base/GHC/ST.lhs:78:1:
You cannot SPECIALISE `forever'
  because its definition has no INLINE/INLINABLE pragma
  (or its defining module `Control.Monad' was compiled without -O)

This was after:

  git clone [...]
  ./sync-all get
  perl boot
  ./configure
  make

Is there some problem with trying to build GHC7 on a machine with GHC6,
or did I just get the build procedure wrong (the last line of the error
looks like a hint that I did).

-- 
Scott Lawrence



signature.asc
Description: OpenPGP digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread Sean Perry
Choices, choices.

The first one is to use unit tests. Look at the grammar and make sure the 
obvious stuff fails or succeeds. a + b, a :+ b, etc. You can do this at the 
Haskell level with parser objects.

Next you can write small samples to test things the unit tests did not. Compare 
the output to known results. There are numerous examples of this in the open 
source world you can either reuse or crib from.

Personally I think QuickCheck is more work than it is worth here.

On Jun 11, 2011, at 8:18, Paul Johnson p...@cogito.org.uk wrote:

 On 11/06/11 14:10, Andrew Coppin wrote:
 OK, so suppose you sit down and write a complicated string parser. Now how 
 do you test that it works correctly?
 
 
 If you have a function that turns a parse tree back into text again, you can 
 try verifying that a round-trip is the identity function. Except perhaps 
 sometimes it isn't. Perhaps a given expression has more than one equivalent 
 representation. A round-trip from string and back again is even less likely 
 to be stable.
 
 So what's the best way to attack this problem?
 
 _
 
 If your parse tree has a show instance (or better yet, a pretty-print 
 function) then you can generate random parse trees, print them, and then show 
 that the parse returns an equal tree.
 
 However if you want to have useful error messages or a wider range of 
 representations than just those generated by show then you will need to 
 write a QuickCheck variant on the show function that emits all these 
 variations, which is likely to be rather more work.
 
 
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread Alexander Solla
On Sat, Jun 11, 2011 at 10:06 AM, Sean Perry sha...@speakeasy.net wrote:

 Choices, choices.

 The first one is to use unit tests. Look at the grammar and make sure the
 obvious stuff fails or succeeds. a + b, a :+ b, etc. You can do this at
 the Haskell level with parser objects.

 Next you can write small samples to test things the unit tests did not.
 Compare the output to known results. There are numerous examples of this in
 the open source world you can either reuse or crib from.


Don't just test the obvious things.   If the parse tree is truly a tree,
it is an initial algebra and amenable to case analysis as an initial
algebra.  In other words, you can do a proof by induction, just by checking
all the base cases.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread briand
On Sat, 11 Jun 2011 10:34:47 -0700
Alexander Solla alex.so...@gmail.com wrote:

 On Sat, Jun 11, 2011 at 10:06 AM, Sean Perry sha...@speakeasy.net wrote:
 
  Choices, choices.
 
  The first one is to use unit tests. Look at the grammar and make sure the
  obvious stuff fails or succeeds. a + b, a :+ b, etc. You can do this at
  the Haskell level with parser objects.
 
  Next you can write small samples to test things the unit tests did not.
  Compare the output to known results. There are numerous examples of this in
  the open source world you can either reuse or crib from.
 
 
 Don't just test the obvious things.   If the parse tree is truly a tree,
 it is an initial algebra and amenable to case analysis as an initial
 algebra.  In other words, you can do a proof by induction, just by checking
 all the base cases.

Wouldn't also be reasonable for the test cases to be generated from the grammar 
automagically ?  Seems much more useful than attempting to do it by hand.  
Seems like something which would have already been done, i.e. there's already a 
tool out there that does that ?

Brian

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Announcing: hashtables-1.0.0.0

2011-06-11 Thread Gregory Collins
Hi all,

I’m very pleased to announce today the release of the first version of
hashtables, a Haskell library for fast mutable hash tables. The
hashtables library contains three different mutable hash table
implementations in the ST monad, as well as a type class abstracting
out the functions common to each and a set of wrapper functions to use
the hash tables in the IO monad. It's also substantially faster than
Data.HashTable. For more information, including performance benchmarks
vs. some of the other common Haskell associative datatypes, please see
my blog post:

http://gregorycollins.net/posts/2011/06/11/announcing-hashtables

Although I’ve made substantial efforts to test this code prior to
release, it is a version 1.0. Please send bug reports to the
hashtables github issues page:
https://github.com/gregorycollins/hashtables/issues.

Thanks!

G
-- 
Gregory Collins g...@gregorycollins.net

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Announcing: hashtables-1.0.0.0

2011-06-11 Thread Michael Snoyman
This is awesome, thanks Greg! I definitely have some code locally that
could benefit from a better hashtable implementation.

Michael

On Sat, Jun 11, 2011 at 9:20 PM, Gregory Collins
g...@gregorycollins.net wrote:
 Hi all,

 I’m very pleased to announce today the release of the first version of
 hashtables, a Haskell library for fast mutable hash tables. The
 hashtables library contains three different mutable hash table
 implementations in the ST monad, as well as a type class abstracting
 out the functions common to each and a set of wrapper functions to use
 the hash tables in the IO monad. It's also substantially faster than
 Data.HashTable. For more information, including performance benchmarks
 vs. some of the other common Haskell associative datatypes, please see
 my blog post:

    http://gregorycollins.net/posts/2011/06/11/announcing-hashtables

 Although I’ve made substantial efforts to test this code prior to
 release, it is a version 1.0. Please send bug reports to the
 hashtables github issues page:
 https://github.com/gregorycollins/hashtables/issues.

 Thanks!

 G
 --
 Gregory Collins g...@gregorycollins.net

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread Kevin Charter
On Sat, Jun 11, 2011 at 7:10 AM, Andrew Coppin
andrewcop...@btinternet.comwrote:


 If you have a function that turns a parse tree back into text again, you
 can try verifying that a round-trip is the identity function. Except perhaps
 sometimes it isn't. Perhaps a given expression has more than one equivalent
 representation. A round-trip from string and back again is even less likely
 to be stable.


I find that this kind of testing works quite nicely in practice with
QuickCheck, in the sense that it does a good job of finding bugs in both the
unparser and the parser. It's possible, but unlikely, that you'll have a bug
in the parser and a bug in the unparser that cancel one another out.
Generate the ASTs; parse . unparse ought to be id, or perhaps t = t . parse
. unparse for some simple transformation 't'. For example, if the parser
annotates AST nodes with source positions, you may need 't' to strip them
out.

Kevin
-- 
Kevin Charter
kevin.char...@acm.org
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fixed points

2011-06-11 Thread Alexander Solla
On Sat, Jun 11, 2011 at 3:19 AM, Max Rabkin max.rab...@gmail.com wrote:

 On Fri, Jun 10, 2011 at 21:05, Alexander Solla alex.so...@gmail.com
 wrote:
  equivalenceClosure :: (Ord a) = Relation a - Relation a
  equivalenceClosure = fix (\f - reflexivity . symmetry . transitivity)

 If you want to learn about fix, this won't help you, but if you're
 just want the best way to calculate equivalence closures of relations,
 then it's probably

 equivalenceClosure = transitivity . symmetry . reflexivity

 assuming those are the transitive, symmetric and reflexive closure
 functions. You still need some kind of iteration to get the transitive
 closure. The algorithm I know of for that is Warshall's Algorithm,
 which is O(N^3) (possibly with a log N factor for pure data
 structures).


Cool, thanks for the suggestion.  I was iterating all of them, since an
iteration of transitive introduces new pairs to the relation (which are
not guaranteed to have symmetric complements in my implementation).  I
suppose I can get away with not iterating reflexive, for something like an
O(n) speed up for each iteration.

This is a summary of the code.  I haven't done order analysis on it.
 Relation is a newtype over a Set of pairs:

-- | Iterate 'transitivity' to compute the transitive closure for a
relation.
transitivity :: (Ord a) = Relation a - Relation a
transitivity (Relation set) = Relation $ (Set.fold _joinOn set) (set)

-- | Compute the reflexive closure for a relation.  In other words, take a
set
--   containing @(a,b)@, @(c,d)@, ... into one containing the originals and
--   @(b,a)@, @(d,c)@, and so on.
reflexivity :: (Ord a) = Relation a - Relation a
reflexivity (Relation set) = Relation $ Set.unions [ set
   , (Set.map (\(x,_) -
(x,x)) set)
   , (Set.map (\(_,y) -
(y,y)) set)
   ]

-- | Compute the symmetric closure for a relation.
symmetry :: (Ord a) = Relation a - Relation a
symmetry (Relation set) = Relation $ Set.union set (Set.map _symmetry set)

_symmetry :: (a, a) - (a, a)
_symmetry (a, b) = (b, a)


_joinOn :: (Ord a) = (a,a) - Set (a,a) - Set (a,a)
_joinOn (a,b) set =
let fst' = Set.filter ((b ==) . fst)  $ set
snd' = Set.filter ((a ==) . snd)  $ set
 in Set.unions [ set
   , Set.map (\(x,y) - (a,y)) fst'
   , Set.map (\(x,y) - (x,b)) snd'
   ]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC7 build problem

2011-06-11 Thread Edward Z. Yang
Yes, the tree was broken for some time between yesterday and today, and you
appear to have gotten unlikely.  It should have been fixed now, so you should
try again.

Cheers,
Edward

Excerpts from Scott Lawrence's message of Sat Jun 11 12:44:18 -0400 2011:
 Trying to compile GHC7 from source (as the ubuntu repository is still on
 GHC6), I came across the following error in the final phase:
 
 libraries/base/GHC/ST.lhs:78:1:
 You cannot SPECIALISE `forever'
   because its definition has no INLINE/INLINABLE pragma
   (or its defining module `Control.Monad' was compiled without -O)
 
 This was after:
 
   git clone [...]
   ./sync-all get
   perl boot
   ./configure
   make
 
 Is there some problem with trying to build GHC7 on a machine with GHC6,
 or did I just get the build procedure wrong (the last line of the error
 looks like a hint that I did).
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fixed points

2011-06-11 Thread Felipe Almeida Lessa
On Sat, Jun 11, 2011 at 4:21 PM, Alexander Solla alex.so...@gmail.com wrote:
 _symmetry :: (a, a) - (a, a)
 _joinOn :: (Ord a) = (a,a) - Set (a,a) - Set (a,a)

A note on style: we use variables starting with an underline _ just
when they are not used.  This kind of use is confusing.

Cheers!

-- 
Felipe.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Florian Weimer
I'm looking for a simple implementation of the STG machine to do some
experiments, preferably implemented in something with memory safety.
Performance is totally secondary.  I'm also not interested in garbage
collection details, but I do want to look at the contents of the
various stacks.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Thomas Schilling
Does Bernie Pope's http://www.haskell.org/haskellwiki/Ministg work for you?

On 11 June 2011 21:19, Florian Weimer f...@deneb.enyo.de wrote:
 I'm looking for a simple implementation of the STG machine to do some
 experiments, preferably implemented in something with memory safety.
 Performance is totally secondary.  I'm also not interested in garbage
 collection details, but I do want to look at the contents of the
 various stacks.

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Push the envelope. Watch it bend.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Don Stewart
See also:

 * STG machine in Coq,
http://www.cs.ox.ac.uk/files/3858/pirog-biernacki-hs10.pdf

http://www.cs.ox.ac.uk/files/3858/pirog-biernacki-hs10.pdfAlso

 * ] Jon Mountjoy. The spineless tagless G-machine, naturally. 1998 ACM
SIGPLAN International Conference on Functional Programming,
SIGPLAN Notices, Vol. 34, No. 1, pages 163–173, Baltimore,
Maryland, September 1998. ACM Press.

On Sat, Jun 11, 2011 at 4:32 PM, Thomas Schilling
nomin...@googlemail.comwrote:

 Does Bernie Pope's http://www.haskell.org/haskellwiki/Ministg work for
 you?

 On 11 June 2011 21:19, Florian Weimer f...@deneb.enyo.de wrote:
  I'm looking for a simple implementation of the STG machine to do some
  experiments, preferably implemented in something with memory safety.
  Performance is totally secondary.  I'm also not interested in garbage
  collection details, but I do want to look at the contents of the
  various stacks.
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 



 --
 Push the envelope. Watch it bend.

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC7 build problem

2011-06-11 Thread Edward Z. Yang
It appears the build is still broken. Sorry! Please stand by, or roll
back the last set of commits.

Edward

Excerpts from Scott Lawrence's message of Sat Jun 11 12:44:18 -0400 2011:
 Trying to compile GHC7 from source (as the ubuntu repository is still on
 GHC6), I came across the following error in the final phase:
 
 libraries/base/GHC/ST.lhs:78:1:
 You cannot SPECIALISE `forever'
   because its definition has no INLINE/INLINABLE pragma
   (or its defining module `Control.Monad' was compiled without -O)
 
 This was after:
 
   git clone [...]
   ./sync-all get
   perl boot
   ./configure
   make
 
 Is there some problem with trying to build GHC7 on a machine with GHC6,
 or did I just get the build procedure wrong (the last line of the error
 looks like a hint that I did).
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Florian Weimer
* Thomas Schilling:

 Does Bernie Pope's http://www.haskell.org/haskellwiki/Ministg work for you?

MiniSTG might do it, I will definitely look at it.  The source
repository is gone, but there's still a tarball on Hackage.  I had
hoped for something more interactive, though.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Yesod: How safe are forms?

2011-06-11 Thread Ertugrul Soeylemez
Hello fellow haskellers,

how far does Yesod.Form protect you from invalid input?  I'm
particularly interested in what happens, when you submit invalid data to
select fields or radio groups.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife = sex)
http://ertes.de/



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Yesod: How safe are forms?

2011-06-11 Thread Michael Snoyman
For select/radio, the form will not validate. The same is true for
most (all?) other fields.

On Sun, Jun 12, 2011 at 2:35 AM, Ertugrul Soeylemez e...@ertes.de wrote:
 Hello fellow haskellers,

 how far does Yesod.Form protect you from invalid input?  I'm
 particularly interested in what happens, when you submit invalid data to
 select fields or radio groups.


 Greets,
 Ertugrul


 --
 nightmare = unsafePerformIO (getWrongWife = sex)
 http://ertes.de/



 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC7 build problem

2011-06-11 Thread Karel Gardas

On 06/11/11 09:37 PM, Edward Z. Yang wrote:

Yes, the tree was broken for some time between yesterday and today, and you
appear to have gotten unlikely.  It should have been fixed now, so you should
try again.


It's probably not fixed yet, since even last night build fails on 
opensolaris builder: 
http://darcs.haskell.org/ghcBuilder/builders/kgardas-opensolaris-x86-head/256/7.html


Thanks,
Karel

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe