[Haskell-cafe] [OT]Help with translating Error Monads to C++

2013-06-24 Thread Larry Evans
Currently in the c++ developers ml, there's a discussion of a proposed Expected or an Either template: http://article.gmane.org/gmane.comp.lib.boost.devel/242496 A lot of the discussion appears, at least to me, to not be aware of how haskell handles similar situations. The above link was to my p

Re: [Haskell-cafe] Formatting function types

2010-12-30 Thread Larry Evans
On 12/30/10 08:17, Henning Thielemann wrote: > > On Thu, 30 Dec 2010, Lauri Alanko wrote: > >> Even nowadays, Haddock deliberately generates the following layout for >> long function types: >> >> openTempFile >>:: FilePath >>-> String >>-> IO (FilePath, Handle) >> >> The layout draws sp

Re: [Haskell-cafe] ";" in do

2010-12-30 Thread Larry Evans
On 12/29/10 22:40, Daryoush Mehrtash wrote: > Why do people put ";" in do {}, or "," in data fields, at the > beginning of the line? > -- It reflects the parse tree better by putting the combining operators (e.g. ';' and ',') at the left and their operands (or combined subtrees) indented to t

Re: [Haskell-cafe] Is there a tutorial interpreter to teach haskell?

2010-12-20 Thread Larry Evans
On 11/30/10 16:46, Stephen Tetley wrote: > Andy Gill developed HERA which sounds somewhat similar to what you are > asking, but I don't know that it would be particularly beginner > friendly and I think it was static - i.e. the reduction rules were > applied to program source code rather than withi

Re: [Haskell-cafe] Bifold: a simultaneous foldr and foldl

2010-12-19 Thread Larry Evans
On 12/07/10 12:36, Henning Thielemann wrote: > > Noah Easterly wrote: >> Somebody suggested I post this here if I wanted feedback. >> >> So I was thinking about the ReverseState monad I saw mentioned on >> r/haskell a couple days ago, and playing around with the concept of >> information flowing t

Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad

2010-12-18 Thread Larry Evans
On 12/17/10 07:07, Daniel Fischer wrote: > On Friday 17 December 2010 13:45:38, Larry Evans wrote: >> WARNING: I clicked on that link in my thunderbird news reader >> and got a page which was something about registering domains. >> It was nothing about Neil's slides. &g

Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad

2010-12-17 Thread Larry Evans
On 12/17/10 01:32, Max Bolingbroke wrote: [snip] > I can't speak for your monad based approach, but you may be interested > in Neil Mitchell's Haskell DSL for build systems, called Shake: > http://community.haskell.org/~ndm/downloads/slides-shake_a_better_make-01_oct_2010.pdf > WARNING: I clicked

Re: [Haskell-cafe] ANN: Digestive functors 0.0.2.0

2010-12-10 Thread Larry Evans
On 12/10/10 10:38, Jasper Van der Jeugt wrote: > Hello, > > Thanks for the error report. Is blaze-html installed correctly? Could > you cabal install blaze-html and verify that you can import Text.Blaze > in ghci? > Here's the terminal session: --{--cut here-- /home/evansl/prog_dev/haskell/my-

Re: [Haskell-cafe] ANN: Digestive functors 0.0.2.0

2010-12-10 Thread Larry Evans
On 12/09/10 16:46, Jasper Van der Jeugt wrote: > Hello all, > > I'm very glad to announce the 0.0.2.0 release of the digestive > functors library. The library provides a general API to input > consumption, and is an upgrade of formlets. > > I've written an announcing blogpost and tutorial with mo

Re: [Haskell-cafe] Bifold: a simultaneous foldr and foldl

2010-12-06 Thread Larry Evans
On 12/01/10 21:35, Larry Evans wrote: [snip] > Hi Noah, > > The attached is my attempt at reproducing your code [snip] > However, ghci compilation of bifold produces an error message: > > BifoldIfRecur.hs:20:19: parse error on input `=' > [snip] Apparently I had so

Re: [Haskell-cafe] Bifold: a simultaneous foldr and foldl

2010-12-03 Thread Larry Evans
On 12/01/10 21:35, Larry Evans wrote: > On 11/30/10 13:43, Noah Easterly wrote: [snip] >> Thanks, Larry, this is some interesting stuff. >> >> I'm not sure yet whether Q is equivalent - it may be, but I haven't been >> able to thoroughly grok it yet. >> [

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 15:47, Iavor Diatchki wrote: > Hi, > You have it exactly right, and I don't think that there's a > particularly deep reason to prefer the one over the other. It seems > that computer science people > tend to go with the (product-function) terminology, while math people > seem to prefer

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 11:19, Iavor Diatchki wrote: > Hi, > Bart Jacobs's book "Categorical Logic and Type Theory" has a > categorical description of a system with dependent types (among > others). The book is fairly advanced but it has lots of details about > the constructions. > Hope this helps, > -Iavor >

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-02 Thread Larry Evans
On 12/02/10 09:13, Petr Pudlak wrote: > Hi, > > recently, I was studying how cartesian closed categories can be used to > describe typed functional languages. Types are objects and morphisms are > functions from one type to another. > > Since I'm also interested in systems with dependent types,

Re: [Haskell-cafe] Bifold: a simultaneous foldr and foldl

2010-12-01 Thread Larry Evans
On 11/30/10 13:43, Noah Easterly wrote: > On Tue, Nov 30, 2010 at 9:37 AM, Larry Evans <mailto:cppljev...@suddenlink.net>> wrote: > > suggested to me that bifold might be similar to the function, Q, of > section 12.5 equation 1) on p. 15 of: > > http:

[Haskell-cafe] Is there a tutorial interpreter to teach haskell?

2010-11-30 Thread Larry Evans
By tutorial interpreter, I means something like an expert system having a list of rules and than a problem which is solved by using those list of rules. The tutorial means the trace of the "problem state" before and after each rule is applied along with which parts of the rule are matched with whi

[Haskell-cafe] Re: Bifold: a simultaneous foldr and foldl

2010-11-30 Thread Larry Evans
On 11/29/10 21:41, Noah Easterly wrote: > Somebody suggested I post this here if I wanted feedback. > > So I was thinking about the ReverseState monad I saw mentioned on > r/haskell a couple days ago, and playing around with the concept of > information flowing two directions when I came up with th

[Haskell-cafe] type universes (was Re: MPTC inheritance

2009-02-28 Thread Larry Evans
On 02/24/09 13:41, Paul Johnson wrote: Derek Gladding wrote: Please forgive me if I'm still mentally contaminated by the OO way of seeing (and discussing) the universe, but I'm trying to figure out how to "inherit an interface" from a multi-parameter type class. [...] but this isn't allowed (k

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-12-01 Thread Larry Evans
On 11/30/08 12:49, Larry Evans wrote: [snip] You'll see Domains can be an mpl::vector of any length. The cross_nproduct_view_test.cpp tests with a 3 element Domains: typedef mpl::vector < mpl::range_c , mpl::range_c , mpl::range_c > doma

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-30 Thread Larry Evans
On 11/30/08 12:27, Luke Palmer wrote: On Sun, Nov 30, 2008 at 11:04 AM, Larry Evans <[EMAIL PROTECTED]> wrote: The following post: http://thread.gmane.org/gmane.comp.lib.boost.devel/182797 shows at least one person that would find it useful, at least in c++. Of course maybe it would b

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-30 Thread Larry Evans
On 11/30/08 12:04, Larry Evans wrote: [snip] The following post: http://thread.gmane.org/gmane.comp.lib.boost.devel/182797 shows at least one person that would find it useful, at least in c++. Of course maybe it would be less useful in haskell. One thing that maybe confusing things is

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-30 Thread Larry Evans
On 11/30/08 11:30, Luke Palmer wrote: On Sun, Nov 30, 2008 at 10:25 AM, Larry Evans <[EMAIL PROTECTED]> wrote: Is there some version of haskell, maybe template haskell, that can do that, i.e. instead of: cross::[[a]] -> [[a]] have: crossn::[a0]->[a1]->...->[an] -> [(a0

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-30 Thread Larry Evans
On 11/23/08 13:52, Luke Palmer wrote: 2008/11/23 Larry Evans <[EMAIL PROTECTED]>: http://www.muitovar.com/monad/moncow.xhtml#list contains a cross function which calculates the cross product of two lists. That attached does the same but then used cross on 3 lists. Naturally, I thought

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-24 Thread Larry Evans
On 11/24/08 00:40, Andrea Vezzosi wrote: It's more natural to consider the cross product of no sets to be [[]] so your crossr becomes: crossr [] = [[]] crossr (x:xs) = concat (map (\h ->map (\t -> h:t) (crossr tail)) hd) which we can rewrite with list comprehensions for conciseness: crossr []

[Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-23 Thread Larry Evans
On 11/23/08 13:52, Luke Palmer wrote: 2008/11/23 Larry Evans <[EMAIL PROTECTED]>: http://www.muitovar.com/monad/moncow.xhtml#list contains a cross function which calculates the cross product of two lists. That attached does the same but then used cross on 3 lists. Naturally, I thought

[Haskell-cafe] howto tuple fold to do n-ary cross product?

2008-11-23 Thread Larry Evans
http://www.muitovar.com/monad/moncow.xhtml#list contains a cross function which calculates the cross product of two lists. That attached does the same but then used cross on 3 lists. Naturally, I thought use of fold could generalize that to n lists; however, I'm getting error: {-- cut here Com

[Haskell-cafe] Re: [off-topic] OOPer?

2008-11-18 Thread Larry Evans
On 11/17/08 18:24, Daniel Yokomizo wrote: > On Mon, Nov 17, 2008 at 9:49 PM, Maurí­cio <[EMAIL PROTECTED] > > wrote: > > > (...) I don't recall where I found the following example, but > copied > > > it locally as compelling evidence that the functional s

[Haskell-cafe] Re: Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Larry Evans
On 11/09/08 17:04, Loup Vaillant wrote: [snip] Err, where can I find such texts? I don't even understand "intuitionistic predicate logic" :-( I just googled that phrase and got many hits. I think metaprl implements something like that: http://metaprl.org/default.html I've often wondered abou

[Haskell-cafe] Re: Examples of Mutually Recursive Types

2008-10-26 Thread Larry Evans
On 10/26/08 17:06, Hugo Pacheco wrote: Probably I overdid the real part. I was thinking of examples such as ASTs (such as the Haskell one), trees and imagining more fancy things, maybe L-systems and fractal processing. I will have a look at the Haskell sources and the previous papers from Tim S

[Haskell-cafe] Re: ghc error: requested module name differs from name found in interface file

2008-10-22 Thread Larry Evans
On 10/21/08 18:55, Larry Evans wrote: On 10/21/08 17:55, Duncan Coutts wrote: On Tue, 2008-10-21 at 09:41 -0500, Larry Evans wrote: Just that one little piece of information, that |cabal install| , by default, installs in ~/.cabal and then enables ghc to look there for packages, would have

[Haskell-cafe] Re: ghc error: requested module name differs from name found in interface file

2008-10-21 Thread Larry Evans
On 10/21/08 17:55, Duncan Coutts wrote: On Tue, 2008-10-21 at 09:41 -0500, Larry Evans wrote: Just that one little piece of information, that |cabal install| , by default, installs in ~/.cabal and then enables ghc to look there for packages, would have saved an awful lot of time :( Where

[Haskell-cafe] Re: ghc error: requested module name differs from name found in interface file

2008-10-21 Thread Larry Evans
On 10/21/08 07:35, Bertram Felgenhauer wrote: Larry Evans wrote: On 10/20/08 12:33, Larry Evans wrote: With a file containing: > module Main where > > import Array > import Control.Functor.Fix I get: > make > ghc -i/root/.cabal/lib/category-extras-0

[Haskell-cafe] Re: ghc error: requested module name differs from name found in interface file

2008-10-20 Thread Larry Evans
On 10/20/08 12:33, Larry Evans wrote: With a file containing: > module Main where > > import Array > import Control.Functor.Fix I get: > make > ghc -i/root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 -c catamorphism.example.hs > > catamorphism.example.hs:19

[Haskell-cafe] ghc error: requested module name differs from name found in interface file

2008-10-20 Thread Larry Evans
With a file containing: > module Main where > > import Array > import Control.Functor.Fix I get: > make > ghc -i/root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 -c catamorphism.example.hs > > catamorphism.example.hs:19:0: > Bad interface file: /root/.cabal/lib/category-extras-0.53.5/ghc-

[Haskell-cafe] howto catamorph monoid (was Re: Is there already an abstraction for this?

2008-10-18 Thread Larry Evans
On 10/18/08 16:48, Larry Evans wrote: [snip] I'm trying to apply this to a simple boolean simplifier shown in the attachment. This attachment is the same as the previous except, instead of a boolean algebra, an monoid is used. [snip] The output of the last line of attachment is:

[Haskell-cafe] Re: Is there already an abstraction for this?

2008-10-18 Thread Larry Evans
On 09/23/08 01:01, Jake Mcarthur wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > The first thing I thought of was to try to apply one of the recursion > schemes > in the category-extras package. Here is what I managed using catamorphism. > > - - Jake > > - > ---

[Haskell-cafe] Re: OPPS, missing attachment (was Re: howto mix <- within do?

2008-10-17 Thread Larry Evans
On 10/17/08 08:12, Daniel Fischer wrote: Thanks very much Daniel. Am Freitag, 17. Oktober 2008 14:42 schrieb Larry Evans: On 10/17/08 07:39, Larry Evans wrote: The attached code produces error: <-- cut here -- [snip] {- Purpose: Explore how to mix 'assignments' inside d

[Haskell-cafe] OPPS, missing attachment (was Re: howto mix <- within do?

2008-10-17 Thread Larry Evans
On 10/17/08 07:39, Larry Evans wrote: The attached code produces error: <-- cut here -- [snip] {- Purpose: Explore how to mix 'assignments' inside do. Motivation: Instead of: let { v0 = e0 ; v1 = e1 } in do { print v0 ; print v1

[Haskell-cafe] howto mix <- within do?

2008-10-17 Thread Larry Evans
The attached code produces error: <-- cut here -- runghc -dcore-lint do_with_assignment.proto.hs do_with_assignment.proto.hs:30:2: Couldn't match expected type `[]' against inferred type `IO' Expected type: [t] Inferred type: IO () In the expression: putStr "v0=" In a 'do'

[Haskell-cafe] Re: [Haskell] Compiler Construction course using Haskell?

2008-08-20 Thread Larry Evans
On 08/20/08 11:43, Derek Elkins wrote: On Wed, 2008-08-20 at 16:03 +0200, Johannes Waldmann wrote: Hello. I plan to give a course in compiler construction, using Haskell as the implementation language (not as source or target language). Something along these lines: 1. combinator parsers (Parse