Re: [Haskell-cafe] Re: List of exports of a module - are there alternatives?

2009-05-13 Thread wren ng thornton
Maurício wrote: I would like a keyword we could add to a single declaration, like: hidden a :: Int -> Int a = (...) The 200 names is not the best example. It's more a question of proportion: if you export 5 declarations in a module with 20, it's OK, but if you export 19 declarations in a module

Re: [Haskell-cafe] Pretty printing a tree

2009-05-15 Thread wren ng thornton
José Romildo Malaquias wrote: Hello. I would like to pretty print a tree in a way that its structure is easily perceived. For instance, consider the declarations: data Node a = Node a [Node a] type Tree a = [ Node a ] t = [ Node "a" [ Node "b" [] , Node "c" [ Node

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread wren ng thornton
Conor McBride wrote: Hi Sittampalam, Ganesh wrote: > Martin Hofmann wrote: > > It is pretty clear, that the following is not a valid Haskell pattern: > > > > foo (x:x:xs) = x:xs > > > > My questions is _why_ this is not allowed. IMHO, the semantics should > > be > > clear: The pattern is expecte

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread wren ng thornton
Conor McBride wrote: Rumblings about funny termination behaviour, equality for functions, and the complexity of unification (which isn't the proposal anyway) But unification is what you get by adding non-linearity. Sure, all terms are ground; would you prefer I said "testing for membership in

Re: [Haskell-cafe] import qualified?

2009-05-22 Thread wren ng thornton
Vasili I. Galchin wrote: Hello, I am working with some somewhat legacy code. I understand what "import qualified Blah as B" means but what does "import qualified Blah" mean? Is this a deprecated feature? I saw with user defined module as well as with "import qualified System" for example.

Re: [Haskell-cafe] hackage version scheme survey

2009-05-23 Thread wren ng thornton
br...@lorf.org wrote: On Saturday, 23.05.09 at 17:26, Don Stewart wrote: > http://haskell.org/haskellwiki/Package_versioning_policy ? That helps a lot. I should have found that. But putting the policy on a web page doesn't seem to be working; there are a lot of non-compliant packages. I guess I

Re: [Haskell-cafe] Haskell type system and the lambda cube

2009-05-25 Thread wren ng thornton
vo...@tcs.inf.tu-dresden.de wrote: > 2009/5/24 Petr Pudlak : > If all Haskell had would be HM, it would be System F. That cannot be quite right, can it? System F has more powerful polymorphism than HM. As I recall HM is along the edge to \lambda^2. Haskell 98 is typically described in terms

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-05-25 Thread wren ng thornton
ntu...@googlemail.com wrote: This however does not work because record selectors have module scope, so the compiler will complain that channel et. al. are defined multiple times. As a workaround I could put each type into its own module, but at least GHC requires a file per module (which is *very

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-05-26 Thread wren ng thornton
ntu...@googlemail.com wrote: wren ng thornton wrote: > A better approach would > probably be to use GADTs or the new data families which give a sort of dual > of typeclasses (typeclasses give a small set of functions for a large set of > types; GADTs give a large set of functions for

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-26 Thread wren ng thornton
Conal Elliott wrote: Hi Tom, I've been working on another code-generating graphics compiler, generating GPU code. As always, I run into the problem of efficient common subexpression elimination. In Pan, Vertigo & Pajama, I used lazy memoization, using stable pointers and weak references, to av

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread wren ng thornton
Johan Tibell wrote: austin s wrote: > Perhaps benchpress would be more to your liking: > > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/benchpress Note that since benchpress measures every single invocation of the provided IO action in order to compute percentiles it's not good a

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread wren ng thornton
Conal Elliott wrote: Hi Wren, I considered the idea of hashing, but not *perfect* hashing. I don't know how to hash perfectly with something like expressions, which have infinitely many values. An imperfect hash can work. You'll need a memo table with a source of unique symbols (e.g. storing

Re: [Haskell-cafe] Type class context propagation investigation

2009-05-27 Thread wren ng thornton
Ryan Ingram wrote: Think of classes like data declarations; an instance with no context is a constant, and one with context is a function. Here's a simple translation of your code into data; this is very similar to the implementation used by GHC for typeclasses: > data EqDict a = EqDict { eq ::

Re: [Haskell-cafe] Re: Error message reform

2009-05-27 Thread wren ng thornton
Max Rabkin wrote: Jeff Wheeler wrote: > I absolutely agree about expected/inferred. I always forget which is > which, because I can figure both could apply to each. That's actually true for me too. When you say it like that, I remember times when I've had the same confusion. [...] My preferen

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-27 Thread wren ng thornton
michael rice wrote: Still exploring monads. I don't understand why the type signature for double is OK, It isn't. The |a| and |b| variables must unify: Prelude> :t \x -> Just (x+x) \x -> Just (x+x) :: (Num a) => a -> Maybe a Prelude> :t (\x -> Just (x+x)) :: Num a => a -> Maybe b

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-28 Thread wren ng thornton
michael rice wrote: Yeah, I went back and tried double again, though I'd swear I got the dang thing to compile (and run) w/o errors. I guess I meant Num. So Num is a class and Int and Integer are types? What are the other classes? Docs? Unification, for me, is pattern matching ala Prolog. Wh

Re: [Haskell-cafe] Re: Error message reform

2009-05-28 Thread wren ng thornton
Claus Reinke wrote: Still, I would really like a "just the facts, please" mode for GHC, with less text and more type signatures (especially for the contexts of type mismatches). Error messages simply not including the information I need has become my main issue with GHC messages, and seems to b

Re: [Haskell-cafe] Ensuring Type Class instances follow the 'rules'

2009-05-29 Thread wren ng thornton
Eugene Kirpichov wrote: Use QuickCheck. Also use SmallCheck or lazy SmallCheck. All of these are automatic tools that allow you to specify laws[1] and automatically generate values for testing the law. QuickCheck generates values randomly, which can be useful but is very often insufficient.

Re: [Haskell-cafe] Re: Error message reform

2009-05-31 Thread wren ng thornton
Tillmann Rendel wrote: wren ng thornton wrote: > (Though it doesn't necessarily generalize to cover similar messages like: > > Prelude> :t (\x -> x) :: a -> b > :1:7: > Couldn't match expected type `b' against inferred type `a' >

Re: [Haskell-cafe] Parsec float

2009-05-31 Thread wren ng thornton
Jason Dusek wrote: 2009/05/30 Bartosz Wójcik : ...reading RWH I could not memorize what those liftM funtions meant. The basic one, `liftM`, means `fmap`, though specialized for functors that are monads. Prelude Control.Monad> :t liftM liftM :: forall a b (m :: * -> *). (Monad m) =

Re: [Haskell-cafe] Trouble with types

2009-06-02 Thread wren ng thornton
Vladimir Reshetnikov wrote: Hi Daniel, Could you please explain what does mean 'monomorphic' in this context? I thought that all type variables in Haskell are implicitly universally quantified, so (a -> a) is the same type as (forall a. a -> a) At the top level (i.e. definition level), yes. Ho

Re: [Haskell-cafe] Possible Haskell Project

2009-06-02 Thread wren ng thornton
Tom Hawkins wrote: At the core, the fundamental problem is not that complicated. It's just storing and retrieving a person's various health events: checkups, prescriptions, procedures, test results, etc. The main technical challenges are database distribution and patient security. Both are fun

Re: [Haskell-cafe] Checking a value against a passed-in constructor?

2009-06-02 Thread wren ng thornton
Ryan Ingram wrote: Dan wrote: > I figured there would be a clever Haskell idiom that would give me a > similarly concise route. Does it really require Template Haskell? I can > barely parse regular Haskell as it is.. [...] Alternatively, you can define a fold[1] once: myval :: MyVal -> (Bool

Re: [Haskell-cafe] Functors and the Visitor Pattern

2009-06-04 Thread wren ng thornton
Tom.Amundsen wrote: So, last night, I was having this problem with my Java code where I couldn't figure out for the life of me how to write a piece of code without a big if {} else if {} else if {} ... else {} structure. I was Googling "Java Reflection" to try to determine how to "cast to the mos

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-04 Thread wren ng thornton
Daniel Peebles wrote: Yeah, in a way similar to ArrowPlus/ArrowZero. Then again, I'm not sure whether it would be meaningful to split up MonadPlus like that. Well, we could always have: class MonadZero m => MonadPlus m The suggestion is just to broaden the scope of mzero so that you can have

Re: [Haskell-cafe] Functors and the Visitor Pattern

2009-06-04 Thread wren ng thornton
Johan Tibell wrote: wren ng thornton wrote: > [2] For the recursive Visitor pattern I use most often, that is. For the > non-recursive version it's usually fmap. This is the part where the pattern > gets a bit shaky because there are actually many different patterns all > call

Re: [Haskell-cafe] Monad transformer responsibilities

2009-06-05 Thread wren ng thornton
Martijn van Steenbergen wrote: Hello, Suppose I have two projects: 1) one that defines a monad transformer and an accompanying type class that captures my monad-specific operations and 2) one that uses the other project, combining the monad transformer with, say, Parsec. Now while writing m

Re: [Haskell-cafe] ghci: can't load .so/.DLL for: m (addDLL: could not load DLL) / is there a libm.dll for Windows

2009-06-07 Thread wren ng thornton
Mark Wassell wrote: Hello, I get this when using the logfloat package via ghci on Windows. For example *Main> :m + Data.Number.LogFloat *Main Data.Number.LogFloat> logFloat (1.0::Float) Loading package syb ... linking ... done. Loading package array-0.2.0.0 ... linking ... done. Loading package

Re: [Haskell-cafe] Slow documentation generation on Hackage

2009-06-08 Thread wren ng thornton
Thomas ten Cate wrote: Niemeijer, R.A. wrote: > which, face it, is going to be all of them; I doubt Haskell > is popular enough yet to be the target of DoS attacks Second that. I think this is a good case in which some security should be traded in for usability. Those who would trade security

Re: [Haskell-cafe] Building a tree?

2009-06-10 Thread wren ng thornton
michael rice wrote: Here's a function from Data.Tree: unfoldTree :: (b -> (a, [b])) -> b -> Tree a Build a tree from a seed value Could someone please give me a brief example of usage. Data.Tree> let t = unfoldTree (\i -> (show i, [i`div`2..i-1])) Data.Tree> putStr . drawTree $ t 8 -

Re: [Haskell-cafe] Building a tree?

2009-06-10 Thread wren ng thornton
michael rice wrote: Here's a function from Data.Tree: unfoldTree :: (b -> (a, [b])) -> b -> Tree a Build a tree from a seed value Could someone please give me a brief example of usage. In as far as understanding it, it may be easier if you look at the generalized version of the anamorphism:

Re: [Haskell-cafe] Building a tree?

2009-06-11 Thread wren ng thornton
michael rice wrote: Example understood. Thanks. Is there a module for binary trees? Not that I know of off hand. Trees are one of those data structures with so many different variants that people end up rolling their own based on whatever they need at the time. Hence Data.Tree, Data.Sequence

Re: [Haskell-cafe] Performance of functional priority queues

2009-06-16 Thread wren ng thornton
Richard O'Keefe wrote: There's a current thread in the Erlang mailing list about priority queues. I'm aware of, for example, the Brodal/Okasaki paper and the David King paper. I'm also aware of James Cook's priority queue package in Hackage, have my own copy of Okasaki's book, and have just spen

Re: [Haskell-cafe] Confusion on the third monad law when using lambda abstractions

2009-06-19 Thread wren ng thornton
Hans van Thiel wrote: On Wed, 2009-06-17 at 21:26 -0500, Jake McArthur wrote: Jon Strait wrote: I'm reading the third (bind associativity) law for monads in this form: m >>= (\x -> k x >>= h) = (m >>= k) >>= h Arguably, that law would be better stated as: (h <=< k) <=< m = h <=< (k

Re: [Haskell-cafe] Re: Need some help with an infinite list

2009-06-20 Thread wren ng thornton
Thomas Hartman wrote: could someone explain sharing? In the code below, allstrings2 is 6X as fast as allstrings. I assume because of sharing, but I don't intuitively see a reason why. can someone give me some pointers, perhaps using debug.trace or other tools (profiling?) to show where the firs

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-24 Thread wren ng thornton
Kamil Dworakowski wrote: The timing per expression however showed something useful, 70% of the time was being spent around determining membership in the known words dictionary (Data.Map). There are about 30 000 items in the dictionary. Right... Python uses hashtables while here I have a tree wit

Re: [Haskell-cafe] Re: Optimizing spelling correction program

2009-06-24 Thread wren ng thornton
Kamil Dworakowski wrote: On Jun 22, 10:03 am, Eugene Kirpichov wrote: Hey, you're using String I/O! nWORDS <- fmap (train . map B.pack . words) (readFile "big.txt") This should be WORDS <- fmap (train . B.words) (B.readFile "big.txt") By the way, which exact file do you use as a misspelling

Re: [Haskell-cafe] coding standard question

2009-06-24 Thread wren ng thornton
Magnus Therning wrote: Erik de Castro Lopo wrote: In Haskell there is an easy way around this. Variables can be name a, a', a'' and so on. Since these aid in clarity without forcing you to think up new variable names, I would suggest that its a good idea to fix these warnings. +1 (depending on

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-24 Thread wren ng thornton
Luke Palmer wrote: On Tue, Jun 23, 2009 at 2:20 AM, wrote: Simple: the definition of MonadState uses those extensions. Thanks, yes it helps and explains all. :^) I suppose then that if -XFlexibleContexts is indeed required by the standard libraries, it is a "safe" extension, meaning supporte

Re: [Haskell-cafe] Error in array index.

2009-06-24 Thread wren ng thornton
Jason Dusek wrote: Why is `Int` used in so many places where it is semantically wrong? Not just here but also in list indexing... Indices/offsets can only be positive and I can't see any good reason to waste half the address space -- yet we encounter this problem over and over again.

Re: [Haskell-cafe] lazy data structure for best-first search

2009-06-24 Thread wren ng thornton
Martin Hofmann wrote: Thanks for the quick and short answer. Maybe I am already thinking too complicated. However, exactly your given preconditions I can not satisfy. The preconditions for bestFirst rate edges xs are: map rate xs must be nondecreasing, Here lies my problem, because edges m

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-25 Thread wren ng thornton
Bulat Ziganshin wrote: Hello wren, Thursday, June 25, 2009, 6:35:36 AM, you wrote: Rank2Types, RankNTypes, ExistentialQuantification, ScopedTypeVariables, and GADTs are fairly benign ---though this is where you start loosing compatibility with non-GHC compilers. afair, except for GADTs thes

Re: [Haskell-cafe] combining monads with IO

2009-06-25 Thread wren ng thornton
Richard Silverman wrote: Hi all, I'm puzzled by something. Suppose I have some code that does lots of IO, and also occasionally refers to some global state. No problem, use ReaderT for the state, combining with the IO monad. Except... since IO is on the bottom, simple uses of do-notation suc

Re: [Haskell-cafe] Haskell on JVM

2009-06-30 Thread wren ng thornton
Claus Reinke wrote: |Basically, the JVM lacks a native ability to do tail calls. It does |not have an instruction to remove/replace a stack frame without |executing an actual return to the calling method/function. There is a conflict between preserving stack layout and efficient tail calls. U

Re: [Haskell-cafe] Network.CGI -- practical web programming example.

2009-07-02 Thread wren ng thornton
Brandon S. Allbery KF8NH wrote: Some Haskell programmers use fmap (because most Monads are also Functors), others use liftM. Both have the same effect: given a monadic computation "m a", "liftM f" turns "f" into a function that operates on the enclosed "a" instead of the entire "m a". That

Re: [Haskell-cafe] ANN: TernaryTrees-0.1.1.1 - An efficient ternary tree implementation of Sets and Maps

2009-07-02 Thread wren ng thornton
Alex Mason wrote: TernaryTrees is a package that extends Data.Set ad Data.Map with some ternary tree structures, based on the article [http://www.pcplus.co.uk/node/3074/] . For the string (or rather ByteString) version: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bytestring-tri

Re: [Haskell-cafe] [ghc] kind of the function arrow

2009-07-02 Thread wren ng thornton
Dominic Orchard wrote: I was just playing around and noticed that the kind of the function arrow in GHC is (?? -> ? -> *) when I (naively) expected it to be (* -> * -> *). After looking at (http://hackage.haskell.org/packages/archive/ghc/6.10.2/doc/html/Type.html#5) I see that the kind of (->)

Re: [Haskell-cafe] ANN: TernaryTrees-0.1.1.1 - An efficient ternary tree implementation of Sets and Maps

2009-07-02 Thread wren ng thornton
Don Stewart wrote: wren: Alex Mason wrote: TernaryTrees is a package that extends Data.Set ad Data.Map with some ternary tree structures, based on the article [http://www.pcplus.co.uk/node/3074/] . For the string (or rather ByteString) version: http://hackage.haskell.org/cgi-bin/hackage-sc

Re: [Haskell-cafe] Flipping *->*->* kinds, or monadic finally-tagless madness

2009-07-03 Thread wren ng thornton
Kim-Ee Yeoh wrote: > > type VarCount = int > > newtype Y b a = Y {unY :: VarCount -> (b, VarCount)} > Hi Edward, Your runPretty version fits the bill nicely, thank you. I might still retain the state monad version because it allows generalizations beyond pretty-printing. As for fixing the origi

Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-03 Thread wren ng thornton
Günther Schmidt wrote: Hi, I've got an IO action, some file system IO, traversing one level only and iterating over files found. I wish to build in an "early" exit, ie. if an IO action in the loop encounters a particular value I want it to abort the loop. Now so far, pls don't shoot, I hav

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

2009-07-09 Thread wren ng thornton
Ignoring the rest of the thread, but jumping in here... hask...@kudling.de wrote: For the hompage we're talking about, glancing is even simpler since everything is on the same page and you can scroll it quite easily. I don't agree that "everything on one page" makes comprehension easier. I'

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

2009-07-09 Thread wren ng thornton
Rick R wrote: As an aside, in the current homepage, the Haskell description is outweighed by the link menu on the left. IMO the reader's eyes should move from the title, to the description, then either down or left. Currently my attention is split evenly between the link menu and the title/descr

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

2009-07-09 Thread wren ng thornton
Don Stewart wrote: ttencate: On Thu, Jul 9, 2009 at 18:33, Don Stewart wrote: 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

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

2009-07-09 Thread wren ng thornton
Jeff Wheeler wrote: I suspect most people who like the Ruby page see the "Ruby is..." section as especially effective at introducing the language, and the random snippet is a simple way to show off a bit of code before they dive into a tutorial. I'll agree that that part is slick. The rest of

Re: [Haskell-cafe] Problems with nested Monads

2009-07-10 Thread wren ng thornton
Job Vranish wrote: Yeah, I think the problem with my case is that while M is a specific monad (essentially StateT), N can be an arbitrary monad, which I think destroys my changes of making a valid joinInner/joinOuter/distribute. Maybe someday Haskell will infer valid joinInner/joinOuter for simpl

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread wren ng thornton
John Dorsey wrote: John, Is it possible to create a circular pure data structure in Haskell? For example: Creating the data structure is easy; as other respondents have pointed out. A simple example is this... ones = 1 : ones ones' = 1 : ones' Comparing these values is harder. All of (on

Re: [Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-18 Thread wren ng thornton
Richard O'Keefe wrote: On Jul 15, 2009, at 5:25 PM, Benjamin L.Russell wrote: it interesting that you should use the biological term "disease"; according to a post [1] entitled "Re: Re: Smalltalk Data Structures and Algorithms," by K. K. Subramaniam, dated "Mon, 29 Jun 2009 11:25:34 +0530," on

Re: [Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-18 Thread wren ng thornton
Richard O'Keefe wrote: On Jul 15, 2009, at 5:25 PM, Benjamin L.Russell wrote: it interesting that you should use the biological term "disease"; according to a post [1] entitled "Re: Re: Smalltalk Data Structures and Algorithms," by K. K. Subramaniam, dated "Mon, 29 Jun 2009 11:25:34 +0530," on

Re: [Haskell-cafe] Haskell Zippers on Wikibooks: teasing! :)

2009-07-18 Thread wren ng thornton
Peter Verswyvelen wrote: After my colleague explained me about zippers and how one could derive the datatype using differential rules, I had to read about it. So I started reading http://en.wikibooks.org/wiki/Haskell/Zippers#Mechanical_Differentiation This page contains the sentence: *"For a s

Re: [Haskell-cafe] A voyage of undiscovery

2009-07-18 Thread wren ng thornton
Andrew Coppin wrote: That seems simple enough (although problematic to implement). However, the Report seems to say that it matters whether or not the bindings are muturally recursive [but I'm not sure precisely *how* it matters...] Seriously, check out the classic Milner paper. Of languages

Re: [Haskell-cafe] A voyage of undiscovery

2009-07-18 Thread wren ng thornton
Andrew Coppin wrote: Robert Greayer wrote: f0 _ = (foo True, foo 'x') where foo = id is well-typed. Really? That actually works? How interesting... This suggests to me that where-clauses also do strange things to the type system. Not too strange, in fact we need it to do that for local

Re: [Haskell-cafe] Re: Debugging methods for haskell

2009-07-18 Thread wren ng thornton
Fernan Bolando wrote: The intention is z0 is a system parameter and database, it contains a set of info needed to define a particular simulation it looks like ( [n,m...], [m,o,p]) n is is a list info settings for the circuit analysis m is a list of statistics for the circuits that is need in su

Re: [Haskell-cafe] Pattern matching with where free variables can be used more than once

2009-07-23 Thread wren ng thornton
Richard O'Keefe wrote: On Jul 18, 2009, at 6:35 AM, Christopher Done wrote: [non-linear patterns] This kind of matching is provided in Prolog and Erlang. Neither of them lets the user define equality. We find the same issue with n+k patterns(e.g., n+1 as a pattern) l++r patte

Re: [Haskell-cafe] Re: FFI to double constants, printf

2009-07-23 Thread wren ng thornton
Brandon S. Allbery KF8NH wrote: On Jul 17, 2009, at 22:27 , Maurí cio wrote: Is there maybe some way to check if a double or long double do have a "proper" value? isNaN :: a -> Bool True if the argument is an IEEE "not-a-number" (NaN) value isInfinite :: a -> Bool True if the argument is an

Re: [Haskell-cafe] lifting restrictions on defining instances

2009-07-23 Thread wren ng thornton
John Lask wrote: Can anyone explain the theoretical reason for this limitation, ie other than it is a syntactical restriction, what would it take to lift this restriction ? There are a couple of theoretical concerns, mainly that full type-level lambdas can lead down a rocky path (though simpl

Re: [Haskell-cafe] lifting restrictions on defining instances

2009-07-24 Thread wren ng thornton
David Menendez wrote: wren ng thornton wrote: John Lask wrote: Can anyone explain the theoretical reason for this limitation, ie other than it is a syntactical restriction, what would it take to lift this restriction ? There are a couple of theoretical concerns, mainly that full type-level

Re: [Haskell-cafe] A Question of Restriction

2009-07-28 Thread wren ng thornton
Brian Troutwine wrote: Hello Wouter. I've had a go at the paper linked and perused other references found with Google. Unfortunately, such sophisticated use of the type system is pretty far out of my normal problem domain and I can't see how to apply the techniques presented to my motivating exa

Re: [Haskell-cafe] lifting restrictions on defining instances

2009-07-28 Thread wren ng thornton
Tillmann Rendel wrote: wren ng thornton wrote: [1] In System F the capital-lambda binder is used for the term-level abstraction of passing type representations. So for example we have, id :: forall a. a -> a id = /\a. \(x::a). x Thus, the forall keyword is serving as the type-le

Re: [Haskell-cafe] lifting restrictions on defining instances

2009-07-28 Thread wren ng thornton
Tillmann Rendel wrote: wren ng thornton wrote: Thus, the forall keyword is serving as the type-level abstraction. What do you mean by "type-level abstraction" here? I mean an abstraction, as in a lambda-abstraction (aka a lambda-expression), at the type level. [...] I&#x

Re: [Haskell-cafe] Efficient functional idiom for histogram

2009-08-05 Thread wren ng thornton
Paul Moore wrote: 2009/8/5 Yitzchak Gale : Or is this with an alternate RNG? Although I think even that would be fair, since Python uses Mersenne. I got the impression Dmitry was using Haskell's standard RNG, not Mersenne Twister. If so, then we'd get further improvements with MT, but that's s

Re: Re[Haskell-cafe] [2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-30 Thread wren ng thornton
staafmeister wrote: The overhead is a O(1) overhead for the function because it needs to check if a computation has already performed. And the space overhead is not so big because every data object in memory there are a couple of references to be stored in lookup tables. So although there is spac

Re: Re[Haskell-cafe] [2]: Re[2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-30 Thread wren ng thornton
Luke Palmer wrote: On Fri, Aug 28, 2009 at 6:04 AM, Bulat Ziganshin wrote: it looks like cache of values computed since the last GC, because on GC all those intermediate results will be collected. i think it's not very useful outside of fib example that does exact that - reusing recently compute

Re: [Haskell-cafe] Trying to reduce memory costs of String duplicates

2009-09-05 Thread wren ng thornton
Günther Schmidt wrote: Hi all, I'm reading in a data of 216k records into a map of Key, Values Pairs, the values being strings. As it happens out of 216k String values there really are only about 6.6k distinct string values, so I could save a lot of RAM if I was able to "insert" only actual

Re: [Haskell-cafe] Type-Level Programming

2010-07-01 Thread wren ng thornton
Andrew Coppin wrote: wren ng thornton wrote: Andrew Coppin wrote: It's a bit like trying to learn Prolog from somebody who thinks that the difference between first-order and second-order logic is somehow "common knowledge". (FWIW, I have absolutely no clue what that differe

Re: [Haskell-cafe] Type-Level Programming

2010-07-01 Thread wren ng thornton
Andrew Coppin wrote: I did wonder what the heck a "type function" is or why you'd want one. And then a while later I wrote some code along the lines of class Collection c where type Element c :: * empty :: c -> Bool first :: c -> Element c So now it's like Element is a function that

Re: [Haskell-cafe] Re: chart "broken" under 6.12 according to criterion

2010-07-01 Thread wren ng thornton
Neil Brown wrote: On 01/07/10 10:19, Tom Doris wrote: According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: flag Chart description: enable use of the Chart package -- Broken under GHC 6.12 so far Does any

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-02 Thread wren ng thornton
Andrew Coppin wrote: Hmm, interesting. Applicative and Traversable are two classes I've never used and don't really understand the purpose of. Their main purpose is to avoid the list bias so prevalent from the Lispish side of FP. Namely, there are many different kinds of collections which can

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-05 Thread wren ng thornton
Ivan Lazar Miljenovic wrote: Stephen Tetley writes: I think it was Hugs compliant as least for some revisions - I seem to remember looking at it before I switched to GHC. People still use Hugs? :p MPJ uses it for teaching Haskell because it's a lot easier to install than GHC. I've heard t

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-05 Thread wren ng thornton
Ivan Lazar Miljenovic wrote: Stephen Tetley writes: On 3 July 2010 14:00, Ivan Lazar Miljenovic wrote: So this argument isn't valid ;-) I think it was Hugs compliant as least for some revisions - I seem to remember looking at it before I switched to GHC. Actually, how would you call it i

Re: [Haskell-cafe] More experiments with ATs

2010-07-05 Thread wren ng thornton
Andrew Coppin wrote: Brent Yorgey wrote: On Sun, Jul 04, 2010 at 10:31:34AM +0100, Andrew Coppin wrote: I have literally no idea what a type family is. I understand ATs (I think!), but TFs make no sense to me. ATs are just TFs which happen to be associated with a particular class. So

Re: [Haskell-cafe] cereal vs. binary

2010-07-06 Thread wren ng thornton
braver wrote: I dump results of a computation as a Data.Trie of [(Int,Float)]. It contains about 5 million entries, with the lists of 35 or less pairs each. It takes 8 minutes to load with Data.Binary and lookup a single key. What can take so long? If I change from compressed to uncompressed

Re: [Haskell-cafe] finding the right mathematical model

2010-07-06 Thread wren ng thornton
Andrew Korzhuev wrote: What sort of model would be suitable to describe this, some sort of matrix? You still can get loops if your matrix represents graph. Sounds like you need a tree. Well, a DAG would suffice and would be less restrictive. Of course, you'd want to have the amendation that s

[Haskell-cafe] Re: The state of Hugs

2010-07-06 Thread wren ng thornton
Ketil Malde wrote: wren ng thornton writes: A bit more seriously: is there any listing anywhere of which extensions Hugs supports? Cabal has a partial listing embedded in its code, though I can't seem to find a textual version at the moment. In general, Hugs has all the features of GH

[Haskell-cafe] Re: the state of Hugs 2

2010-07-06 Thread wren ng thornton
Daniel Fischer wrote: On Tuesday 06 July 2010 07:04:18, wren ng thornton wrote: Cabal has a partial listing embedded in its code, though I can't seem to find a textual version at the moment. In general, Hugs has all the features of GHC 6.6: FFI, CPP, MPTCs, FunDeps, OverlappingInstances,..

Re: [Haskell-cafe] Functional dependencies and Peano numbers

2010-07-09 Thread wren ng thornton
Brandon S Allbery KF8NH wrote: On 7/6/10 15:37 , Oscar Finnsson wrote: but can they also be on a form similar to a b c d e f g h| b c -> d e f | b d g -> h (i.e. d,e,f are decided by the b,c-combination while h is decided by the b,d,g-combination)? I think the answer to this is "yes, but i

Re: [Haskell-cafe] Comments on Haskell 2010 Report

2010-07-09 Thread wren ng thornton
Julian Fleischer wrote: Hi, 8. [...] Saying 0**0 is undefined seems reasonable, but why 0**y? I agree on 0**y being 0 (not undefined), but why should 0**0 be undefined? x**0 := 1, by convention. I'm not familiar with that convention. So far as I'm aware, the x**0=1 vs 0**y=0 conflict leads

Re: [Haskell-cafe] Comments on Haskell 2010 Report

2010-07-09 Thread wren ng thornton
Christopher Done wrote: On 10 July 2010 01:22, Ivan Lazar Miljenovic wrote: Brandon S Allbery KF8NH writes: On 7/8/10 22:25 , Alex Stangl wrote: 1. I.E. and e.g. should be followed by commas -- unless UK usage differs from US standards. (Page 3 and elsewhere, although FFI chapter I don't t

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-10 Thread wren ng thornton
Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/10/10 17:01 , Antoine Latter wrote: * The way you use sed doesn't work with the BSD sed that ships with my Mac Book. Installing GNU sed and using it works. Similarly, BSD find doesn't know about '-name', so make h

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-10 Thread wren ng thornton
John Meacham wrote: On Sat, Jul 10, 2010 at 04:01:53PM -0500, Antoine Latter wrote: * running DrIFT on src/E/TypeCheck.hs fails with an illegal bytesequence in hGetContents. I'm guessing that this is only an issue when building DrIFT with GHC 6.12+, and that the file contains bytes illegal in UT

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-15 Thread wren ng thornton
Brandon S Allbery KF8NH wrote: wren is half right: at the level of Unixy APIs (and this includes anything that goes on in a Terminal window and anything that you will be doing from Haskell) you use UTF8, but OSX APIs --- that is, Carbon and Cocoa --- use UTF16. So for the purposes of ghc/jhc OS

Re: [Haskell-cafe] Re: lambda calculus and equational logic

2010-07-15 Thread wren ng thornton
Patrick Browne wrote: Heinrich Apfelmus wrote: 3) Not sure what you mean by proof theoretic semantics. Apparently, the trace of any program execution like, say product [1..5] -> 1 * product [2..5] -> .. -> 120 is a proof that the initial and the final expression denote the same value. The

Re: [Haskell-cafe] trees and pointers

2010-07-15 Thread wren ng thornton
Jake McArthur wrote: On 07/15/2010 05:33 PM, Victor Gorokhov wrote: From the docs, lookup is O(min(n,W)) Actually worse than O(log n). Perhaps I am misunderstanding you, but O(min(n,W)) is either better than or the same as O(log n), depending on how you look at things, but I don't see any w

Re: [Haskell-cafe] A question about State Monad and Monad in general

2010-07-15 Thread wren ng thornton
C K Kashyap wrote: Thanks Daniel, Better refactorability. If you're using monadic style, changing from, say, State Thing to StateT Thing OtherMonad or from StateT Thing FirstMonad to StateT Thing SecondMonad typically requires only few changes. Explicit state-passing usually requires more cha

Re: [Haskell-cafe] Re: Functional dependencies and Peano numbers (and hoogle-bug?)

2010-07-15 Thread wren ng thornton
Oscar Finnsson wrote: Anyone made a module/package that solves this problem already? I cannot be the first that needs generic type safe conversion... . There's a restricted version in logfloat:Data.Numer.RealToFrac[1] which generalizes the Prelude's realToFrac to improve performance and correc

Re: [Haskell-cafe] Refactoring type-class madness

2010-07-15 Thread wren ng thornton
Andrew Webb wrote: Because, at the basic level all of the experiments share this type of data, it seems that I should be able to write analysis functions that work for any experiment. However, the experiments differ in the stimuli used, and associated with each stimulus set is a set of "milestone

Re: [Haskell-cafe] trees and pointers

2010-07-16 Thread wren ng thornton
Jan-Willem Maessen wrote: As you observe, it's really down to constant factors. The reason IntMap (or any digital trie) is so interesting is that it is simple enough that the constant factors are quite good---in particular we don't waste a lot of time figuring out if we're going to need to rearr

Re: [Haskell-cafe] in-equality type constraint?

2010-07-17 Thread wren ng thornton
Christopher Lane Hinson wrote: On Fri, 16 Jul 2010, Paul L wrote: Does anybody know why the type families only supports equality test like a ~ b, but not its negation? I would suggest that type equality is actually used for type inference, whereas proof of type inequality would have no conseq

Re: [Haskell-cafe] Re: Hot-Swap with Haskell

2010-07-17 Thread wren ng thornton
Brandon S Allbery KF8NH wrote: On 7/16/10 05:21 , Andy Stewart wrote: IMO, "haskell interpreter" is perfect solution for samll script job. But i'm afraid "haskell interpreter" is slow for *large code*, i don't know, i haven't try this way... Hugs? Or you can try implementing (or finding) a S

Re: [Haskell-cafe] RE: Design for 2010.2.x series Haskell Platform site (Don Stewart)

2010-07-17 Thread wren ng thornton
Niemeijer, R.A. wrote: Here's my take on the new design: Screenshot: http://imgur.com/9LHvk.jpg Live version: http://dl.dropbox.com/u/623671/haskell_platform_redesign/index.htm Is it just me, or does aligning [OSX,Win,Linux] `zip` [Comprehensive, Robust, CuttingEdge] send the wrong message...

[Haskell-cafe] Re: Design for 2010.2.x series Haskell Platform site (Don Stewart)

2010-07-19 Thread wren ng thornton
Niemeijer, R.A. wrote: Is it just me, or does aligning [OSX,Win,Linux] `zip` [Comprehensive, Robust, CuttingEdge] send the wrong message... Yeah, I noticed that too when designing it, but at the time it didn't bother me too much. I know folks who'd refute all three of those associations, so.

<    1   2   3   4   5   6   7   8   9   10   >