Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Alexander Solla
On Oct 26, 2010, at 4:21 PM, Richard O'Keefe wrote: Number theory would probably be out except maybe in a 2nd or 3rd year course leading to cryptography. Number theory is one of those weird cases. They are discrete structures, but advanced number theory uses a lot of complex analysis an

Re: [Haskell-cafe] How can I use MACID in my existing application?

2010-11-04 Thread Alexander Solla
On Nov 4, 2010, at 10:48 AM, Dupont Corentin wrote: Hello, I'm wondering how can I use Happstack's MACID in my application without breaking everything. I have a monad like that: type Comm = StateT Communication IO ... Whereas MACID asks to use: type Update state = Ev (StateT state STM)

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-04 Thread Alexander Solla
On Nov 4, 2010, at 9:51 AM, Stephen Tetley wrote: Without interviewing the people concerned its probably impossible to actually find out what influenced what - even though list comprehensions have a long history the designers of Python might have only seen them in Haskell so Python could well h

[Haskell-cafe] Type Families

2009-09-20 Thread Alexander Solla
(I'm using a fixed width font, so if you don't see nice formatting, you need to use a fixed width font. This is literate Haskell, but I copied and pasted the code. YMMV) Hi Everybody! (Hi Dr. Nick) I've been looking for a good way to use some richer notions of polymorphism than Haskell98

Re: [Haskell-cafe] Design question

2009-12-28 Thread Alexander Solla
There are many SVG elements, of which only a few are valid as the content of each other SVG elements. SvgDocumentElement defines the allowed subset for the SVG document. I want to generate a "DList Char" for all those sub-elements and finally collapse them to one "DList Char" representing

Re: [Haskell-cafe] Request to review my attempt at understanding Monads

2009-12-29 Thread Alexander Solla
I happen to think that the only good way to approach monads is mathematically. Uses come out naturally, once you understand what it is that a monad "does". I'll make a short speech and then comment on your questions. First, an example. I will assume that there are some things you will

Re: [Haskell-cafe] foldl in terms of foldr

2010-01-26 Thread Alexander Solla
On Jan 26, 2010, at 8:11 AM, Xingzhi Pan wrote: I'm a little confused with the type of step here. Can it be considered as taking 2 or 3 arguments and then the compiler has to infer to decide? The compiler is going to build up a sequence of functions. Consider the following (mathematical)

Re: [Haskell-cafe] foldl in terms of foldr

2010-01-26 Thread Alexander Solla
> f :: a -> b -> c is a function that takes an a, a b, and returns a c. Except that f and g are not isomorphic. In fact, there exists no defined fuction g :: (a -> b) -> c (what type would (g id) be? The types are isomorphic. They both have the same extension. Both types are empty. Ho

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Alexander Solla
On Jan 27, 2010, at 4:57 PM, Conor McBride wrote: Yes, the separation is not clear in Haskell. (I consider this unfortunate.) I was thinking of Paul Levy's call-by-push-value calculus, where the distinction is clear, but perhaps not as fluid as one might like. What, exactly, is the suppos

Re: [Haskell-cafe] C functional programming techniques?

2010-01-30 Thread Alexander Solla
On Jan 29, 2010, at 9:11 AM, Maurí cio CA wrote: Sorry if this looks weird, but do you know of experiences with functional programming, or "type programming", with C? Using macro tricks or just good specifications? I know this is not absurd to a small extent. I've heard of proof tool certifi

Re: [Haskell-cafe] Re: C functional programming techniques?

2010-01-31 Thread Alexander Solla
On Jan 30, 2010, at 5:26 PM, Maurí cio CA wrote: Do you have some link to an example of such proof by induction of type safety? Not off-hand, but I did just find Atze Dijkstra's Essential Haskell, which covers the type system in depth, and it looks like a good bet for you. http://www.cs.

Re: [Haskell-cafe] Anyone recommend a VPS?

2010-01-31 Thread Alexander Solla
On Jan 31, 2010, at 12:02 PM, Michael Snoyman wrote: I'm working with a client right now on deploying an app. I was wondering if anyone had some recommendations for a Haskell-friendly host. I'm inclined to go with a VPS for this setup, but if there's reliable shared hosting, that would d

[Haskell-cafe] Non-termination using Free Monads and Data Types a la Carte

2013-09-27 Thread Alexander Solla
I am trying to use a data types a la carte approach to define a free monad for templating purposes. I am using Edward Kmett's free package, and a module implementing data types a la carte's injections, modelled on the IOSpec Types module. I have written a few combinators, but I am stuck. My progra

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-01 Thread Alexander Solla
On Mon, Sep 30, 2013 at 11:58 PM, Michael Snoyman wrote: > I'm wondering if anyone's run into this problem before, and if there's a > common solution. > > I ran into it, asked about it on SO, and followed your advice. :) ___ Haskell-Cafe mailing list Has

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-26 Thread Alexander Solla
2011/12/24 MigMit > > > Отправлено с iPad > > 24.12.2011, в 18:50, Alexander Solla написал(а): > > In the same way, denotational semantics adds features which do not apply > to a theory of finite computation. > > > And why exactly should we limit ourselves to

Re: [Haskell-cafe] I Need a Better Functional Language!

2012-04-09 Thread Alexander Solla
On Thu, Apr 5, 2012 at 7:14 AM, Grigory Sarnitskiy wrote: > Hello! I've just realized that Haskell is no good for working with > functions! > > First, what are 'functions' we are interested at? It can't be the usual > set-theoretic definition, since it is not constructive. The constructive > defi

Re: [Haskell-cafe] A functional programming solution for Mr and Mrs Hollingberry

2012-05-27 Thread Alexander Solla
On Sun, May 27, 2012 at 7:07 PM, Richard O'Keefe wrote: > > On 26/05/2012, at 4:16 AM, David Turner wrote: > > > > I don't. I think the trouble is that classes don't add value in > exercises of this size. > > This was the key point, I think. > In this example, there wasn't any significant behavio

Re: [Haskell-cafe] How to select n random words from a file ...

2012-06-10 Thread Alexander Solla
On Sun, Jun 10, 2012 at 6:21 AM, Noon Silk wrote: > Hi, > > I'm clearly new to haskell, and I suppose those is a basic question, > but after a bit of searching I've been unable to figure out the "best" > way to do this. I was first trying to find out how to, say, get a > random element from a li

Re: [Haskell-cafe] event handler

2012-06-14 Thread Alexander Solla
On Thu, Jun 14, 2012 at 12:15 PM, Corentin Dupont wrote: > Hi folks, > I'm trying to make a simple event driven engine. It simply consists of two > functions: > - "addEvent", where you pass the event name with a callback, > - "triggerEvent" where you pass the event name with the data. > the data

Re: [Haskell-cafe] event handler

2012-06-14 Thread Alexander Solla
On Thu, Jun 14, 2012 at 2:04 PM, Corentin Dupont wrote: > That look really nice! > Unfortunately I need to have an heterogeneous list of all events with > their handlers. > With this test code it won't compile: > > test1 = addEvent (New :: Event Player) (H (undefined::(Player -> IO ( > [] > te

Re: [Haskell-cafe] event handler

2012-06-15 Thread Alexander Solla
w a) ++ "!" > h2 :: Rule -> IO () > h2 (R a) = putStrLn $ "New Rule " ++ (show a) > eventList1 = addEvent (New :: Event Player) (H h1) [] > eventList2 = addEvent (New :: Event Rule) (H h2) eventList1 > > trigger1 = triggerEvent (New :: Event Player) (P 1) eventLis

Re: [Haskell-cafe] event handler

2012-06-16 Thread Alexander Solla
On Fri, Jun 15, 2012 at 1:59 PM, Corentin Dupont wrote: > I made some modifications based on your suggestions (see below). > I made a two parameters class: > *class (Typeable e, Typeable d) => Handled e d * > Because after all what I want is to associate an event with its type > parameters. > I t

Re: [Haskell-cafe] event handler

2012-06-16 Thread Alexander Solla
On Sat, Jun 16, 2012 at 3:31 PM, Corentin Dupont wrote: > Hi Alexander, > sorry my initial example was maybe misleading. What I really what to do is > to associate each event with an arbitrary data type. For example, consider > the following events: > NewPlayer > NewRule > Message > User > > I wan

Re: [Haskell-cafe] How do people still not understand what FP is about? What are we doing wrong?

2012-06-18 Thread Alexander Solla
On Mon, Jun 18, 2012 at 1:39 PM, Jonathan Geddes wrote: > I believe you are observing and commiserating over what Paul Graham > famously refers to as "the blub paradox"[0]. > > Here is the problem from my perspective. It is a bootstrapping problem: > you have to think FP is good to invest the time

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-21 Thread Alexander Solla
On Thu, Jun 21, 2012 at 7:00 AM, George Giorgidze wrote: > > > > > Regarding antisymmetry, if I also define > > > > instance Ord Foo where > > (==) = (==) `on` a > > > > then would that count as satisfying the law? > > Probably, you mean here Eq instead of Ord. > > If a <= b and b <= a then a = b

Re: [Haskell-cafe] Why does Enum succ and pred functions throw exception

2012-06-22 Thread Alexander Solla
On Thu, Jun 21, 2012 at 5:36 PM, Richard O'Keefe wrote: It always struck me as odd that Enum doesn't extend Ord. > There's a reason given for not having Bounded extend Ord, > which doesn't really apply to a class having fromEnum :: a -> Int. > Testing whether an enum bound is at a limit is thus a

Re: [Haskell-cafe] Why does Enum succ and pred functions throw exception

2012-06-22 Thread Alexander Solla
I hit reply instead of reply all. Sorry Richard. On Fri, Jun 22, 2012 at 4:35 PM, wrote: > > > An ordering does not typically induce a computable enumeration. For > > example, there are infinitely many rationals between any pair of > > rationals. > > I didn't say it was odd that Ords weren't E

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-24 Thread Alexander Solla
On Sun, Jun 24, 2012 at 12:27 AM, Chris Dornan wrote: > > * To move between functional and monadic code you have to completely > rewrite the code procedurally -- its >true and (IMHO) regrettable. > It's false. do-notation is completely optional. It merely makes it easier to extract multipl

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-24 Thread Alexander Solla
On Sun, Jun 24, 2012 at 2:48 AM, Chris Dornan wrote: > > > To move between functional and monadic code you have > > > to completely rewrite the code procedurally > > > It's false. do-notation is completely optional. It merely makes it > > easier to extract multiple values from monadic actions,

Re: [Haskell-cafe] Is (==) commutative?

2012-07-25 Thread Alexander Solla
Depending on the context, it may or may not be wise to distinguish between undefined and [undefined]. This is a matter of strictness, laziness, and totality. If you identify all bottoms as one, you essentially restrict yourself to (what might as well be, for the purposes of this discussion) a str

Re: [Haskell-cafe] Is (==) commutative?

2012-07-25 Thread Alexander Solla
On 7/25/12, Christian Sternagel wrote: > On 07/26/2012 11:53 AM, Alexander Solla wrote: >> The classically valid inference: >> >> (x == y) = _|_ => (y == x) = _|_ > Btw: whether this inference is valid or not depends on the semantics of > (==) and that's

Re: [Haskell-cafe] Is (==) commutative?

2012-07-25 Thread Alexander Solla
On 7/25/12, Christian Sternagel wrote: > Dear Alexander, > > On 07/26/2012 01:09 PM, Alexander Solla wrote: >> On 7/25/12, Christian Sternagel wrote: >>> On 07/26/2012 11:53 AM, Alexander Solla wrote: >>>> The classically valid inference: >>>&g

Re: [Haskell-cafe] Reddy on Referential Transparency

2012-07-27 Thread Alexander Solla
On Fri, Jul 27, 2012 at 12:06 PM, Ross Paterson wrote: > On Fri, Jul 27, 2012 at 07:19:40PM +0100, Chris Dornan wrote: > > > So a language is referentially transparent if replacing a sub-term > with another with the same > > > denotation doesn't change the overall meaning? > > > > Isn't this just

Re: [Haskell-cafe] MonadPlus m => Maybe a -> m a

2012-07-28 Thread Alexander Solla
On Sat, Jul 28, 2012 at 8:00 AM, Thiago Negri wrote: > I'm solving this exercise: > > http://www.haskell.org/haskellwiki/All_About_Monads#Exercise_4:_Using_the_Monad_class_constraint > > I'm missing a function to transform a Maybe a into a MonadPlus m => m a. > I did search on Hoogle with no luck

Re: [Haskell-cafe] Current state of garbage collection in Haskell

2012-07-29 Thread Alexander Solla
On Sun, Jul 29, 2012 at 12:52 AM, C K Kashyap wrote: > Hi, > I was looking at a video that talks about GC pauses. That got me curious > about the current state of GC in Haskell - say ghc 7.4.1. > Would it suffer from lengthy pauses when we talk about memory in the range > of 500M +? > What would

Re: [Haskell-cafe] [Haskell] Spam on the Haskell wiki

2012-07-30 Thread Alexander Solla
On Mon, Jul 30, 2012 at 2:35 PM, Henk-Jan van Tuyl wrote: > > > - Verify new wiki accounts, before granting them rights, >based on e-mails in the Haskell mailing lists >(or subscription of a Haskell mailing list) This is a nice idea, but I think it will end up moving spam onto the mailin

Re: [Haskell-cafe] [Haskell] Spam on the Haskell wiki

2012-08-02 Thread Alexander Solla
On Thu, Aug 2, 2012 at 4:46 PM, wren ng thornton wrote: > On 7/30/12 5:35 PM, Henk-Jan van Tuyl wrote: > >> - Block creation of usernames >> o ending with two or more digits >> o with more than one x or q >> o starting with "buy" >> o longer than 20 characters >> o with more than 4 consonants in

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Alexander Solla
On Fri, Aug 3, 2012 at 11:34 PM, Matthew wrote: > I'm a somewhat experienced coder but I am relatively new to Haskell. > I've got a question about whether a usage of do notation is idiomatic, > or whether it's better to use pattern matching. > > I've got two functions which take an input and retu

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Alexander Solla
On Tue, Aug 7, 2012 at 11:03 AM, Daniel Trstenjak < daniel.trsten...@gmail.com> wrote: > > Hi all, > > it should be possible a call a function on all elements of the data > structure, to add and remove elements. > > What I currently have: > > the type class: > > class Foo a where >hasId :: a -

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-11 Thread Alexander Solla
On Sat, Aug 11, 2012 at 12:01 PM, Antoine Latter wrote: > It should be pretty easy to write an adapter function of type "String -> > (Show a => a)". > Not with that type. Give it a try. Hint: what is the extension of the type variable 'a'? What do you know about it? How would you use that t

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Alexander Solla
On Mon, Aug 13, 2012 at 6:25 PM, Jay Sulzberger wrote: > > > On Mon, 13 Aug 2012, Ryan Ingram wrote: > > On Mon, Aug 13, 2012 at 12:30 PM, Jay Sulzberger wrote: >> >> Does Haskell have a word for "existential type" declaration? I >>> have the impression, and this must be wrong, that "forall"

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-16 Thread Alexander Solla
On Thu, Aug 16, 2012 at 8:07 PM, wren ng thornton wrote: > On 8/15/12 2:55 PM, Albert Y. C. Lai wrote: > >> On 12-08-15 03:20 AM, wren ng thornton wrote: >> >>> (forall a. P(a)) -> Q <=> exists a. (P(a) -> Q) >>> >> >> For example: >> >> A. (forall p. p drinks) -> (everyone drinks) >> B. exists p

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-02 Thread Alexander Solla
On Sun, Sep 2, 2012 at 9:40 AM, wrote: > The thing is, that one ALWAYS wants to create a union of types, and not > merely an ad-hock list of data declarations. So why does it take more code > to do "the right thing(tm)" than to do "the wrong thing(r)"? > Because a union type is a complex union

Re: [Haskell-cafe] From monads to monoids in a small category

2012-09-04 Thread Alexander Solla
On Tue, Sep 4, 2012 at 3:39 AM, Alberto G. Corona wrote: > "Monads are monoids in the category of endofunctors" > > This Monoid instance for the endofunctors of the set of all elements > of (m a) typematch in Haskell with FlexibleInstances: > > instance Monad m => Monoid (a -> m a) where >

Re: [Haskell-cafe] From monads to monoids in a small category

2012-09-04 Thread Alexander Solla
On Tue, Sep 4, 2012 at 4:21 PM, Alexander Solla wrote: > > > On Tue, Sep 4, 2012 at 3:39 AM, Alberto G. Corona wrote: > >> "Monads are monoids in the category of endofunctors" >> >> This Monoid instance for the endofunctors of the set of all elements

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Alexander Solla
On Fri, Sep 14, 2012 at 2:18 PM, Andrew Pennebaker < andrew.penneba...@gmail.com> wrote: > A summary of the changes I've included so far: > > Noted and reflected... I'm trying to convey to an audience largely > composed of Java and C++ fanatics how Haskell records are much better than > OOP, how G

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Alexander Solla
On Fri, Sep 14, 2012 at 7:13 PM, Andrew Pennebaker < andrew.penneba...@gmail.com> wrote: > Challenge: get someone to have a competition at one of the conferences >> where students all give their >> best "five minute monad talk" and try to find the most comprehensible one! >> > > Challenge accepted

Re: [Haskell-cafe] Type error with Type families

2012-09-17 Thread Alexander Solla
On Mon, Sep 17, 2012 at 10:59 AM, Ryan Ingram wrote: > The problem is that the function 'element' is ambiguous, for the reasons > MigMit pointed out. > > The standard solution to this problem is to add a dummy argument to fix > the type argument to the type function: > > data Proxy a = Proxy > >

Re: [Haskell-cafe] a parallel mapM?

2012-09-28 Thread Alexander Solla
On Fri, Sep 28, 2012 at 11:01 AM, Greg Fitzgerald wrote: > > > I also tried Control.Parallel.Strategies [2]. While that route works, > I had to use unsafePerformIO. Considering that IO is for sequencing > effects and my IO operation doesn't cause any side-effects (besides > hogging a file handle

Re: [Haskell-cafe] Class constraints with "free" type variables and fundeps

2012-09-28 Thread Alexander Solla
On Fri, Sep 28, 2012 at 5:04 PM, Francesco Mazzoli wrote: > CCing the list back. > > At Fri, 28 Sep 2012 13:30:52 -0700, > Alexander Solla wrote: > > What is the problem, exactly? It looks to me like UndecidableInstances > and > > ScopedTypeVariables (on foo, or its

Re: [Haskell-cafe] Class constraints with "free" type variables and fundeps

2012-09-28 Thread Alexander Solla
On Fri, Sep 28, 2012 at 5:36 PM, Francesco Mazzoli wrote: > At Fri, 28 Sep 2012 17:19:36 -0700, > Alexander Solla wrote: > > Well, then what exactly is the problem? Are you getting an error? > > ...well yes. The error I get with the posted class declarations is > &g

Re: [Haskell-cafe] Optimal line length for haskell

2012-10-29 Thread Alexander Solla
On Mon, Oct 29, 2012 at 6:52 AM, Michael Orlitzky wrote: > On 10/29/2012 07:50 AM, Rustom Mody wrote: > > There was a recent discussion on the python list regarding maximum line > > length. > > It occured to me that beautiful haskell programs tend to be plump (ie > > have long lines) compared to o

Re: [Haskell-cafe] Optimal line length for haskell

2012-10-29 Thread Alexander Solla
On Mon, Oct 29, 2012 at 4:09 PM, Richard O'Keefe wrote: > > On 30/10/2012, at 3:28 AM, Alexander Solla wrote: > > On Mon, Oct 29, 2012 at 6:52 AM, Michael Orlitzky > wrote: > > In any language, a line longer than 80 characters usually (but not > > always) sugg

Re: [Haskell-cafe] Cabal failures...

2012-11-20 Thread Alexander Solla
> Thanks to all for the comparisons between apt & cabal. > Your reply basically explains why it is broken, and gives a rationale > (cost and trouble to do it), but no prognosis for repair. > It's an open problem. I make do with disposable sand-boxes, using cabal-dev to build them. In this way, I

Re: [Haskell-cafe] AST Rewriting

2012-11-20 Thread Alexander Solla
Have you read "Data types a la carte"? The 'syntactic' package implements the ideas, but it was a little dense for my purposes when I looked (I just wanted data types, a la carte; it focuses on manipulating ASTs defined a la carte). It might be what you need, or you can roll your own based on the

Re: [Haskell-cafe] Category Theory and Haskell

2012-11-25 Thread Alexander Solla
The general idea of category theory is to come up with formalizations of common abstract "patterns" found in mathematical constructs. For example, there are homomorphisms of groups, vector spaces (under linear transformations), topological spaces (under continuous functions), etc. Category theory

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
I don't mean to be blunt, but have you guys taken a course in linear algebra? On Mon, Dec 3, 2012 at 9:21 PM, Trevor L. McDonell < tmcdon...@cse.unsw.edu.au> wrote: > As far as I am aware, the only description is in the Repa paper. I you are > right, it really should be explained properly somewh

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
t doesn't stop me from being curious with Accelerate. Might you > have a better explaination for what's happening here than Trevor's? > > - Clark > > > On Tue, Dec 4, 2012 at 7:08 PM, Alexander Solla wrote: > >> I don't mean to be blunt, but have you guy

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
Sorry, I didn't realize that course was offered next year. I read through "Matrices and Linear Algebra" when I was in high school. And used Friedberg, Insel, Spence's "Linear Algebra" in college. On Tue, Dec 4, 2012 at 4:37 PM, Alexander Solla wrote: > Well,

Re: [Haskell-cafe] ANNOUNCE: tie-knot library

2012-12-11 Thread Alexander Solla
As a matter of fact, BSD is far more popular on the desktop than GPL. And has a huge share of the mobile market. Witness: OS X, iOS. And none of this has anything to do with Haskell. Petr can release *his* code with any license he wants. Some licenses fit into *this* ecosystem better than othe

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-18 Thread Alexander Solla
On Tue, Dec 18, 2012 at 4:49 PM, Ertugrul Söylemez wrote: > These laws make morphisms isolated and composition lightweight as well > as undisturbing. Now try to transfer these notions to a concrete > category, for example the category of web servers: The objects are sets > and a morphism f : A

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-19 Thread Alexander Solla
On Tue, Dec 18, 2012 at 11:53 PM, Christopher Howard < christopher.how...@frigidcode.com> wrote: > I really like the idea that all > parts of my program could be cleanly and systematically composed from > smaller pieces, in some beautiful design patter. Many of the problems in > my practical progr

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-20 Thread Alexander Solla
On Thu, Dec 20, 2012 at 12:53 PM, Oleksandr Manzyuk wrote: > I have no problems with the statement "Objects of the category Hask > are Haskell types." Types are well-defined syntactic entities. But > what is a morphism in the category Hask from a to b? Commonly, people > say "functions from a t

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2012-12-31 Thread Alexander Solla
Since you have done a significant amount of work with Haskell, I must presume you have a solid understanding of monads. If so, I can suggest reading http://stackoverflow.com/questions/2704652/monad-in-plain-english-for-the-oop-programmer-with-no-fp-background/13656209#13656209 It is "for the OO

Re: [Haskell-cafe] Where is the "convergence point" between Category Theory and Haskell?

2013-01-13 Thread Alexander Solla
There was a conversation on the cafe about this last month. Check out: https://groups.google.com/forum/#!topic/haskell-cafe/tBO2AowUvMY Category theory is a "language" of composition. In "logical" terms, different categories are models of different axioms. That said, a "rich enough" category i

[Haskell-cafe] Container libraries

2013-01-20 Thread Alexander Solla
Hi everybody, What is the state of container libraries? I am looking for a library which provides: * unordered containers (for "operational" type safety, I don't want to impose orders on things that don't have them -- unordered containers does this) * can handled nested containers (containers do

Re: [Haskell-cafe] Container libraries

2013-01-20 Thread Alexander Solla
On Sun, Jan 20, 2013 at 11:39 AM, Ertugrul Söylemez wrote: > > What is the state of container libraries? I am looking for a library > > which provides: > > > > * unordered containers (for "operational" type safety, I don't want to > > impose orders on things that don't have them -- unordered con

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread Alexander Solla
On Fri, Jan 25, 2013 at 12:39 PM, wrote: > ** > > > This has the code smell of trying to use typeclasses for OOP. That > won't work. (Yes, really.) > > > > I am not trying to use OOP, I am just writing some typecasting at all. > > > > > This would be correct. Constraints on an instance are app

Re: [Haskell-cafe] Parsec without data declarations/AST

2013-02-19 Thread Alexander Solla
If all you want to do is check that the code is valid (i.e., you aren't going to interpret the code), you can just return a Bool. If you want to interpret it, but don't want to have a Stmt type, you can return IO () actions. In that case, the parser's type will be Parser (IO ()) I think an alge

Re: [Haskell-cafe] Parsec without data declarations/AST

2013-02-19 Thread Alexander Solla
, Alexander Solla wrote: > If all you want to do is check that the code is valid (i.e., you aren't > going to interpret the code), you can just return a Bool. If you want to > interpret it, but don't want to have a Stmt type, you can return IO () > actions. In that case, the

Re: [Haskell-cafe] Parsec without data declarations/AST

2013-02-22 Thread Alexander Solla
String) or make an algebraic data type. Note that Either a b is an algebraic data type defined by: > data Either a b = Left a | Right b > will cause an error unless name and number are created using the value > constructors ID and Num and are both the data type Express. Anybody have &

Re: [Haskell-cafe] The state of binary (de)serialization

2013-02-25 Thread Alexander Solla
On Mon, Feb 25, 2013 at 11:59 AM, Johan Tibell wrote: > > There are some blog posts and comments out there about merging cereal >> and binary, is this what's the goal/going on (cfr runGetIncremental)? >> > > It's most definitely the goal and it's basically done. The only thing I > don't think we'l

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Alexander Solla
On Tue, Feb 26, 2013 at 3:28 PM, Corentin Dupont wrote: > Hello everybody! > I am very happy to announce the beta release [1] of Nomyx, the only game > where You can change the rules. > This is an implementation of a Nomic [2] game in Haskell (I believe the > first complete implementation). In a N

Re: [Haskell-cafe] What pattern is this (Something.T -> IO a) in Sound.ALSA.Sequencer

2013-03-03 Thread Alexander Solla
On Sun, Mar 3, 2013 at 10:28 AM, Martin Drautzburg wrote: > Hello all, > > this was previously posted on Haskell Beginners, but only partially > answered. > > In Sound.ALSA.Sequencer, there are a number of functions which together > set up > a midi environement (client, port, queue). They all hav

Re: [Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

2013-04-03 Thread Alexander Solla
On Wed, Apr 3, 2013 at 8:28 AM, Johannes Waldmann < waldm...@imn.htwk-leipzig.de> wrote: > > All of this just because it seemed, at some time, > a clever idea to allow the programmer to omit quantifiers? > (I know, mathematicians do this all over the place, > but it is never helpful, and especiall

Re: [Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

2013-04-04 Thread Alexander Solla
On Thu, Apr 4, 2013 at 3:29 PM, Albert Y. C. Lai wrote: > On 13-04-04 01:07 AM, wren ng thornton wrote: > >> When the quantifiers are implicit, we can rely on the unique human ability >> to DWIM. This is a tremendous advantage when first teaching people about >> mathematical concerns from a logic

[Haskell-cafe] Fwd: meaning of "referential transparency"

2013-04-06 Thread Alexander Solla
On Sat, Apr 6, 2013 at 10:43 AM, Henning Thielemann < lemm...@henning-thielemann.de> wrote: > > Can someone enlighten me about the origin of the term "referential > transparency"? I can lookup the definition of "referential transparency" in > the functional programming sense in the Haskell Wiki an

Re: [Haskell-cafe] unsafeInterleaveST (and IO) is really unsafe

2013-04-19 Thread Alexander Solla
On Fri, Apr 12, 2013 at 3:37 PM, Timon Gehr wrote: > > Please see Sec >> 10.2 Unique supply trees -- you might see some familiar code. Although >> my example was derived independently, it has the same kernel of >> badness as the example in Launchbury and Peyton-Jones. The authors >> point out a

Re: [Haskell-cafe] Why were datatype contexts removed instead of "fixing them"?

2013-04-28 Thread Alexander Solla
On Sun, Apr 28, 2013 at 10:29 AM, gs wrote: > Brandon Allbery gmail.com> writes: > > > ... which means that implementers should be free to "fix" data type > contexts > > however they like, as they are now complier extensions which won't > conflict > > with standard Haskell. > > > > Except that p

Re: [Haskell-cafe] Why were datatype contexts removed instead of "fixing them"?

2013-04-28 Thread Alexander Solla
On Sun, Apr 28, 2013 at 10:55 AM, gs wrote: > Alexander Solla gmail.com> writes: > > > I do not support that criterion. We use theory to ENSURE that no > real-world code will break. > > By theoretical example, I meant something which you would never expect to > fi

Re: [Haskell-cafe] Markdown extension for Haddock as a GSoC project

2013-04-28 Thread Alexander Solla
On Sun, Apr 28, 2013 at 6:10 PM, Richard A. O'Keefe wrote: > > Damn! Why did Watts Humphrey have to die before he'd convinced > the world that the cheapest way to fix bugs is to keep them out > in the first place? I think that much has to do with the historical division in computer science. We

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Alexander Solla
On Thu, May 2, 2013 at 6:26 AM, Adrian May wrote: > So WASH is ancient history. OK, lets forget it. > > How about the Haskell Platform? Is that ancient history? Certainly not: it > doesn't compile on anything but the very newest GHC. Not 7.4.1 but 7.4.2. > GHC is up to 7.6. > Now that's rapid m

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Alexander Solla
> > > >> Now that's rapid maintenance, but it's still version hell because you've >> got to have that compiler installed first (even though HP is supposed to be >> a way to acquire haskell) and you probably haven't. You've probably got the >> one from the linux package which hasn't been maintained

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Alexander Solla
On Thu, May 2, 2013 at 8:43 PM, Adrian May wrote: > >> Also, the Haskell Platform ./configure step checks which version of GHC >> you have installed, and requires you to pass the option --enable-* >> unsupported*-*ghc*-version in order to compile it with anything other >> than GHC 7.4.2. >> >> Did

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Alexander Solla
On Fri, May 3, 2013 at 6:34 AM, Adrian May wrote: > > > > On 3 May 2013 18:56, Ertugrul Söylemez wrote: > >> Adrian May wrote: >> >> > > Changes already made in the base library or in one of the platform >> > > libraries: >> > >> > So could you pick the most unassailable and tell me more about i

Re: [Haskell-cafe] A use case for *real* existential types

2013-05-10 Thread Alexander Solla
I'm not sure if it would work for your case, but have you considered using DataKinds instead of phantom types? At least, it seems like it would be cheap to try out. http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/kind-polymorphism-and-promotion.html On Fri, May 10, 2013 at 12:52 PM, Leon

Re: [Haskell-cafe] A use case for *real* existential types

2013-05-10 Thread Alexander Solla
On Fri, May 10, 2013 at 3:31 PM, Leon Smith wrote: > On Fri, May 10, 2013 at 5:49 PM, Alexander Solla wrote: > >> I'm not sure if it would work for your case, but have you considered >> using DataKinds instead of phantom types? At least, it seems like it would

Re: [Haskell-cafe] GADT and instance deriving

2013-05-24 Thread Alexander Solla
On Fri, May 24, 2013 at 10:41 AM, Niklas Hambüchen wrote: > On Sat 25 May 2013 00:37:59 SGT, TP wrote: > > Is this the right way to go? Is there any other solution? > > I believe whether it's right or just depends on what you want to express. > > > Do you confirm that tilde in s~s1 means "s has t

Re: [Haskell-cafe] GADT and instance deriving

2013-05-24 Thread Alexander Solla
On Fri, May 24, 2013 at 9:37 AM, TP wrote: > Hello, > > I continue my learning of "not so obvious" Haskell/GHC topics when > encountering problems in the code I write. > Below is a small example of an heterogeneous list, using GADT, inspired > from: > > http://en.wikibooks.org/wiki/Haskell/Existe

Re: [Haskell-cafe] ANNOUNCE: new bridge! (prelude-prime)

2013-05-26 Thread Alexander Solla
On Thu, May 23, 2013 at 6:13 AM, Roman Cheplyaka wrote: > * Manuel Gómez [2013-05-23 08:33:15-0430] > > On Thu, May 23, 2013 at 3:07 AM, Roman Cheplyaka > wrote: > > > Pull requests are welcome, but let's stick to widely agreed changes > > > (like the Foldable/Traversable one). I think one of t

[Haskell-cafe] Hackage Update Brigade

2013-05-27 Thread Alexander Solla
As per recent discussions, I'm making a list of volunteers who are willing to pick up some slack in Hackage package maintenance, so that we can submit an amendment to the Haskell Prime Committee's ticket 113 ( http://hackage.haskell.org/trac/haskell-prime/ticket/113) I think that showing that peop

Re: [Haskell-cafe] mapFst and mapSnd

2013-05-31 Thread Alexander Solla
On Thu, May 30, 2013 at 10:56 PM, Tony Morris wrote: > class BinaryFunctor f where > bimap :: (a -> c) -> (b -> d) -> f a b -> f c d > > mapFst = (`bimap id`) > mapSnd = bimap id > There's a bifunctors package with: class Bifunctor f where bimap :: ... first :: a -> b -> f a c -> f b

Re: [Haskell-cafe] Flagstone problem

2010-11-06 Thread Alexander Solla
On Nov 6, 2010, at 4:03 AM, Brent Yorgey wrote: Doesn't make much sense to me. The sum of binary digits in the binary representation of n will not be zero very often... I think they mean "the sum (mod 2)" when they say "the sum of binary digits". That should be zero "half" the time.

Re: [Haskell-cafe] Finding the contents of haskell platform?

2010-11-06 Thread Alexander Solla
On Nov 6, 2010, at 3:56 AM, Stephen Tetley wrote: Modern browsers might add in arrow from a different font if it is not present in the one chosen by the web page author - I suspect this is happening on this page where the arrow "looks wrong" typographically: I don't think that's what's going

Re: [Haskell-cafe] Serialization of (a -> b) and IO a

2010-11-11 Thread Alexander Solla
On Nov 11, 2010, at 1:42 PM, Stephen Tetley wrote: [*] In case anyone looks up MacGuffin on Wikipedia, I don't think the description there is strictly accurate. A MacGuffin doesn't drive the plot so much as throw the viewer of the scent. I think Hitchcock might disagree with you. In any case

Re: [Haskell-cafe] Serialization of (a -> b) and IO a

2010-11-12 Thread Alexander Solla
On Nov 12, 2010, at 10:40 AM, rocon...@theorem.ca wrote: [1]Actaully the realizer for serialize is *weaker* that this axioms. The realizer for serialize would be (Nat -> Nat) -> IO Nat instead of (Nat -> Nat) -> Nat, so should have less impact that the Church-Turing axiom. I don't see w

Re: [Haskell-cafe] Serialization of (a -> b) and IO a

2010-11-12 Thread Alexander Solla
On Nov 12, 2010, at 12:44 PM, Andrew Coppin wrote: Just today I was thinking about how useful it would be if you could send a block of code from one PC to another to execute it remotely. The fact that you can't do this is basically why there's no distributed Haskell yet, despite what an ob

Re: [Haskell-cafe] Making monadic code more concise

2010-11-15 Thread Alexander Solla
On Nov 15, 2010, at 9:43 AM, Ling Yang wrote: Specifically: There are some DSLs that can be largely expressed as monads, that inherently play nicely with expressions on non-monadic values. This, to me, is a big hint that applicative functors could be useful. Every monad is an applicative

Re: [Haskell-cafe] Bracket around every IO computation monad

2010-11-15 Thread Alexander Solla
On Nov 15, 2010, at 4:15 PM, Mitar wrote: True. Approach with "operational" is really beautiful. And it is really great when you want things done. But for me, Haskell novice who wants to learn more, it hides too much. So it is probably something I would use in my code, but on the other hand I w

Re: [Haskell-cafe] Re: Making monadic code more concise

2010-11-16 Thread Alexander Solla
On Nov 16, 2010, at 12:36 PM, Ling Yang wrote: Are only 'trivial' results possible, or that the incomputability problems are just moved into type space? That's typically the case, under Rice's theorem. A construct is derivable if it works for all cases (i.e., it's a "free theorem"), or

<    1   2   3   >