Re: [Haskell-cafe] ghc overlapping instances - solved

2007-12-06 Thread Steffen Mazanek
Hello, Isaac, this works for me. Thx a lot, Steffen 2007/12/5, Isaac Dupree [EMAIL PROTECTED]: Steffen Mazanek wrote: Hi, Stefan and Isaac, thx for providing quick advice. @Stefan: Unfortunately I have to use a list. @Isaac: I do not get it. Could you please provide a short

Re: [Haskell-cafe] ghc overlapping instances

2007-12-05 Thread Steffen Mazanek
::Program main = mapM_ (\(s,a) - putStrLn s a) [(flowchart construct and parse, test prop_ConstructParse)] 2007/12/4, Stefan O'Rear [EMAIL PROTECTED]: On Tue, Dec 04, 2007 at 03:36:20PM +0100, Steffen Mazanek wrote: Hello, I want to quickcheck a property on a datatype representing programs

[Haskell-cafe] ghc overlapping instances

2007-12-04 Thread Steffen Mazanek
Hello, I want to quickcheck a property on a datatype representing programs (=[Stmt]) and need to define a specific instance instance Arbitrary [Stmt] (mainly to restrict the size of the list). In quickcheck an instance Arbitrary of lists is already defined. Which parameters do I have to give

[Haskell-cafe] standard function

2007-06-06 Thread Steffen Mazanek
Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... Steffen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: standard function

2007-06-06 Thread Steffen Mazanek
Cool! Haskell surprised me once again :) @Paul: Thank you for pointing me to the old thread. @Neil: Is there a way to let hoogle find this kind of stuff? It would be a quite complex inference though. 2007/6/6, apfelmus [EMAIL PROTECTED]: Steffen Mazanek wrote: is there a function f::[a-b

Re: [Haskell-cafe] Re: CYK-style parsing and laziness

2007-05-26 Thread Steffen Mazanek
Note that there are very systematic and natural ways to derive dynamic programming algorithms in functional languages. In a sense, much of the work of R. Bird centers this topic. The book Algebra of Programming http://web.comlab.ox.ac.uk/oucl/research/pdt/ap/pubs.html#Bird-deMoor96:Algebra

[Haskell-cafe] CYK-style parsing and laziness

2007-05-23 Thread Steffen Mazanek
Hello, I have two questions regarding a Cocke, Younger, Kasami parser. Consider this program: type NT = Char -- Nonterminal type T = Char -- Terminal -- a Chomsky production has either two nonterminals or one terminal on its right-hand side type ChomskyProd = (NT, Either T (NT, NT)) -- a

Re: [Haskell-cafe] Re: CYK-style parsing and laziness

2007-05-23 Thread Steffen Mazanek
Once again thank you apfelmus :-) The key point of the dynamic programming algorithm is indeed to memoize the results gs i j for all pairs of i and j. In other words, the insight that yields a fast algorithm is that for solving the subproblems gs i j (of which there are n^2), solution to

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Steffen Mazanek
.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577 Neubiberg Tel: +49 (0)89 6004-2505 Fax: +49 (0)89 6004-4447 E-Mail: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] List algorithm

2007-05-21 Thread Steffen Mazanek
Hello, is there an efficient algorithm that takes two positive numbers n and m and that computes all lists l of numbers 0x=n such that sum l = m? For instance alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 = [[1,1,1],[1,2],[2,1],[3]] ... I know that filter (\l-sum l == m) (powerSet [1..n])

Re: [Haskell-cafe] Profiling, measuring time

2007-05-20 Thread Steffen Mazanek
Thats it! Thanks a lot. I do not even need forceOutput, because I perform a bottom-up analysis. And the timeline I got looks sooo great (perfect polynomial behavior :-)) Best regards, Steffen 2007/5/20, Matthew Brecknell [EMAIL PROTECTED]: Steffen Mazanek: I have written a function f

[Haskell-cafe] Profiling, measuring time

2007-05-19 Thread Steffen Mazanek
, Steffen -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577 Neubiberg Tel: +49 (0)89 6004-2505 Fax: +49 (0)89 6004-4447 E-Mail: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] generate Haskell code from model

2007-05-10 Thread Steffen Mazanek
love Haskell with a passion - I'm curious whether I love or hate the combination) Thanks Neil On 5/9/07, Steffen Mazanek [EMAIL PROTECTED] wrote: I have done some experiments relating to our discussion. The approach to generate Haskell code from UML class diagrams is not very promising

Re: [Haskell-cafe] generate Haskell code from model

2007-05-09 Thread Steffen Mazanek
-mazanek.de/blog/2007/05/visual-language-howto.html Best regards, Steffen 2007/4/14, Brian Smith [EMAIL PROTECTED]: On 4/14/07, Steffen Mazanek [EMAIL PROTECTED] wrote: Brian, but don't you think that you have to write a lot of boilerplate code in Haskell? I have never felt I was writing

Re: [Haskell] Re: Quicksearch vs. lazyness

2007-04-16 Thread Steffen Mazanek
___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577 Neubiberg Tel: +49 (0)89 6004-2505 Fax: +49 (0)89 6004

Re: [Haskell-cafe] Tutorial on Haskell

2007-04-16 Thread Steffen Mazanek
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577 Neubiberg Tel: +49 (0)89 6004-2505 Fax: +49 (0)89 6004-4447 E

[Haskell-cafe] generate Haskell code from model

2007-04-13 Thread Steffen Mazanek
are well known. Best practices in programming are propagated, for Haskell e.g. use different modules for different things, use the tedious import/export lists, Haddock your code... What are your ideas? Best regards, Steffen -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie

Re: [Haskell-cafe] generate Haskell code from model

2007-04-13 Thread Steffen Mazanek
have no choice and are not allowed to discuss the sense of this approach :-) How should the code look like? Best regards, Steffen 2007/4/13, Brian Smith [EMAIL PROTECTED]: On 4/13/07, Steffen Mazanek [EMAIL PROTECTED] wrote: Hello everybody, I would like to start a discussion on how

Re: [Haskell-cafe] generate Haskell code from model

2007-04-13 Thread Steffen Mazanek
structures that operate on this data. How would you procede? This is similar to HaXML that helped you to generate Haskell types for an xml schema. Best regards, Steffen -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577

[Haskell] Quicksearch vs. lazyness

2007-03-19 Thread Steffen Mazanek
Hello, say, we want to find the k'th element in a sorted list. In imperative languages it is much more efficient to not use quicksort first and get the k'th element later, but to use a quicksearch algorithm that sorts only the relevant parts of the array. In Haskell one could implement this

[Haskell-cafe] Re: [Haskell] Haskell Chess

2007-03-19 Thread Steffen Mazanek
Hello again, first of all, thank you Don for your help in making hsChess accessible. I have to have a look at darcs and cabal first :-) I have added some more content and a discussion page to the wiki, please contribute your thoughts. Furthermore I added a link to the german project and task

Re: [Haskell-cafe] Haskell Chess

2007-03-19 Thread Steffen Mazanek
I originally used a more general approach (probably similar to the one you refer to), but kicked generality out in favor of simplicity. In teaching one should probably just discuss this aspect, but stay with the simple approach (I'll add a note to the wiki page :-)). In contrast, for the real

Re: [Haskell] Haskell Chess

2007-03-18 Thread Steffen Mazanek
for the exercises so I started the wiki page http://haskell.org/haskellwiki/Learning_Haskell_With_Chess on this topic. I will add more content when I am back to office. Every contribution and discussion is welcome. Best regards, Steffen Steffen Mazanek schrieb: Hello, I recently implemented

[Haskell] Haskell Chess

2007-03-16 Thread Steffen Mazanek
of the gametree and the application of the minimax algorithm can be easily generalized. If somebody is interested I gladly provide the used project definition and the particular work orders (in German only). Best regards, Steffen Mazanek -- Dipl.-Inform. Steffen Mazanek Institut für

Re: [Haskell] main::[String]-IO() ?

2004-03-25 Thread Steffen Mazanek
Hello, thank you for all the valuable comments. A main function with arguments would correspond better to the principle of the least surprise, however, you are perfectly right with your arguments, too. getArgs is not so hard to remember I guess :-) Bye, Steffen

Re: [Haskell] main::[String]-IO() ?

2004-03-23 Thread Steffen Mazanek
Hello again. Since type signature declarations for functions are generally considered good practice, those who use - getArgs would actually need to type two extra characters. And those who do not use getArgs typically (which may or may not be the case in general), would type an extra 14

[Haskell] main::[String]-IO() ?

2004-03-22 Thread Steffen Mazanek
Hello everybody, each time I write an application that makes use of command line arguments I have to copypaste the code for dealing with these args to my program from a reference implementation, because it is so hard to remember. What do you think about changing the default type of main or

Re: [Haskell] HaXml and XML Schema

2004-03-11 Thread Steffen Mazanek
Hello, thank you for the references. Looks promising. I will read it carefully. A nice solution I really like was found by Alastair Reid. He proposed to me (hope it is ok to cite this) the declaration: data Salutation = [Either Char Name] We think it will not scale well, too, however, it is

Re: GHC and Kinds

2003-10-30 Thread Steffen Mazanek
. I may well split the two types in the future. This would be great. Thank you for the informations, Steffen Mazanek ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: GHC and Kinds

2003-10-30 Thread Steffen Mazanek
. I may well split the two types in the future. This would be great. Thank you for the informations, Steffen Mazanek ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

GHC and Kinds

2003-10-29 Thread Steffen Mazanek
with Typing Haskell in Haskell and I really expected a declaration like data Kind = Star | Kfun Kind Kind Any help is greatly appreciated. Regards, Steffen Mazanek ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman

command line option --show-iface

2003-10-27 Thread Steffen Mazanek
Hello, the following error is slightly confusing: ghc --show-iface ghc-6.0.1: unrecognised flag: --show-iface Usage: For basic information, try the `--help' option. ghc --show-iface Unify.hi __interface Main Unify 1 where __export Unify Unifiable{mgu} match mguType varBind; ... A hint

Re: literate comments

2003-10-27 Thread Steffen Mazanek
this? Do you see even more advantages of this approach or would it be senseless work? Regards, Steffen Mazanek [1] http://www.openmath.org/ [2] http://www.ross.net/funnelweb/ ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman

Re: GHC Lexer

2003-10-21 Thread Steffen Mazanek
is changing so fast... Regards, Steffen Mazanek ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

GHC Lexer

2003-10-17 Thread Steffen Mazanek
Hello, to add a new keyword, say struct to the GHC, I have added ITstruct to data type Token in module Lex.lhs. Further on I have adapted ghcExtensionKeywordsFM. Is this already sufficient for lexing? In LexCore there is a function lexKeyword without a comment. It is called by lexer if the

literate comments

2003-10-15 Thread Steffen Mazanek
Hello, in the Haskell report the latex code environment is mentioned: http://www.haskell.org/onlinereport/literate.html Would it make sense, to add a xml like code environment as well, e.g., code.../code? Ciao, Steffen ___ Haskell mailing list [EMAIL

Re: constructor name clashes

2003-10-09 Thread Steffen Mazanek
Hello. Also, when declaring named fields of a type, such as data Data1 = Data1{ok1::Bool} data Data2 = Data2{ok2::Bool} the field names for different type also have to be unique. All function declarations in a module have to be unique. And, e.g., the data constructor Data1 is a function with

Real world example needed for ...

2003-09-25 Thread Steffen Mazanek
Hello, I am looking for a real world example of a type constructor, that expects another type constructor as an argument in the context of subtyping, e.g., one could define --not Haskell98 data T a b c = F (a b c) a::T (-) Pt Pt a = F id b::T (-) CPt CPt b = F id l = [a,b] Thereby CPt is assumed

Re: proving the monad laws

2003-09-04 Thread Steffen Mazanek
Hello, thank you for the idea of using variables directly to see what happens. This is really a simplification for the proof. At first I thought that there should be a simpler solution and I tried to modify your approach, so that it applies to = as well, but now I am convinced :-) I have

Re: Problem with Infinite Lists

2003-09-03 Thread Steffen Mazanek
Hello, all_fib :: [Float] You define all_fib to return a list of Float, but even does only work for numbers whose type is an instance of the class Integral, e.g. Int. HTH and ciao, Steffen ___ Haskell-Cafe mailing list [EMAIL PROTECTED]

Re: Haskell for non-Haskell's sake

2003-09-02 Thread Steffen Mazanek
miss convenient and standardized libraries for gui-programming! I think, this is a serious problem. Bye, Steffen Mazanek P.S. I do my best to motivate other people to give Haskell a try, e.g. during a lecture about document-description-languages I had provided a funny example, how useful HaXml

Re: Haskell-report, chapter 3 - Expressions

2003-08-30 Thread Steffen Mazanek
Thank you. The '10' should be explained in the report as well. Ciao, Steffen ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

proving the monad laws

2003-08-30 Thread Steffen Mazanek
Hello, consider the following monad (which is a slight adaptation of the one used in Typing Haskell in Haskell) as given: data Error a = Error String | Ok a data TI a = TI (Subst - Int - Error (Subst, Int, a)) instance Monad TI where return x = TI (\s n - Ok (s,n,x)) TI f = g = TI (\s n -

Re: Exhaustive Pattern-Matching

2003-08-28 Thread Steffen Mazanek
Thank you all for your help. I will try this ghc-flag. It is interesting as well, that in contrast to Haskell Standard ML ensures, that pattern-matches are exhaustive and irredundant. Ciao, Steffen ___ Haskell mailing list [EMAIL PROTECTED]

Haskell-report, chapter 3 - Expressions

2003-08-28 Thread Steffen Mazanek
Hello, I do not completely understand the first part of chapter 3 of the Haskell-report. Concretely I am stumbling about the notation of nonterminals indexed by their precedence level. This should be a number ranging from 0 to 9. But what about this exp^{10} production rule? I would be very

Exhaustive Pattern-Matching

2003-08-27 Thread Steffen Mazanek
Hello, I have a question about pattern-matching. In the Haskell-report it is not postulated, that pattern matching has to be exhaustive. Would it be possible at all to implement an algorithm, which checks Haskell-style patterns for exhaustiveness? What kinds of complication can be expected?

hiddencode

2003-06-15 Thread Steffen Mazanek
code environments? If not I would prefer a command line option. What do you think about this? Ciao, Steffen -- Steffen Mazanek - www.steffen-mazanek.de - GPG: 791F DCB3 Haskell, that's where I just curry until fail, unwords any error, drop all undefined, maybe break, otherwise in sequence

Re: hiddencode

2003-06-15 Thread Steffen Mazanek
. Ciao, Steffen -- Steffen Mazanek - www.steffen-mazanek.de - GPG: 791F DCB3 Haskell, that's where I just curry until fail, unwords any error, drop all undefined, maybe break, otherwise in sequence span isControl and take max $, id: (d:[]) ___ Haskell

Re: labelled fields

2003-06-04 Thread Steffen Mazanek
Ok, I had missed something: I can write instead: data Type = TCon String (Maybe String) ... and declare a function lmtc lmtc (TCon _ x) = x ... But why not allow syntactic sugar? Sorry, Steffen -- Steffen Mazanek - www.steffen-mazanek.de - GPG: 791F DCB3 Haskell, that's where I just

Re: AW: simulating dynamic dispatch

2003-03-24 Thread Steffen Mazanek
Interestingly, when I want hugs to show me the type of fun::(forall a.[a]-Int)-[b]-[c]-Int it tells me: ERROR - Use of fun requires at least 1 argument Why that? At least I have explicitely specified the type. Hmm, ghci behaves properly. But using hugs I get the same error :-(. No idea!

History of Haskell, first draft

2003-03-19 Thread Steffen Mazanek
Hello, a first draft of my little Haskell-history collection is online now: http://pseiko.gmxhome.de/pseiko/Haskell-History.html Please note, that one part is still just copied from http://www.idt.mdh.se/kurser/cd5100/ht02/history.html but I hope it will evolve quickly. Moreover some parts

old hugs versions?

2003-03-17 Thread Steffen Mazanek
of Johan Nordlanders ohugs (http://www.cs.chalmers.se/~nordland/ohugs/). Thanks in advance, Steffen Mazanek ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Haskell History

2003-03-17 Thread Steffen Mazanek
quit a lot of dead links in the internet, wasting time and staying without results. Help me to close this existing gap. All suggestions are welcome. Steffen Mazanek ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Haskell History

2003-03-17 Thread Steffen Mazanek
Hello again, See Conception, evolution, and application of functional programming languages by Paul Hudak. That's a great starting point for a History of Haskell page: http://portal.acm.org/citation.cfm?doid=72551.72554 thank you, I will read it. You're welcome to steal the simple layout

Re: Function wows

2003-03-05 Thread Steffen Mazanek
Hello, frombin :: [Bit] - Int frombin [] = 0 frombin (n:ns) = sum (n:( frombin (map (*2) ns))) frombin takes a list of Bits and returns an Int, but (:) needs a list as its second argument. Try something like frombin (n:ns) = n + 2*(frombin ns) or frombin = foldr (\x y-x+2*y) 0 Ciao,

Re: Tutorial for literate Haskell

2003-03-04 Thread Steffen Mazanek
this will help. Ciao, Steffen -- Steffen Mazanek Werner Heisenberg Weg 102 App. 232 85579 Neubiberg GPG key fingerprint: A165 227D B288 5E10 701D BF5F E91C 6B88 24C8 397D http://blackhole.pca.dfn.de:11371/pks/lookup?op=getsearch=0x24C8397D

Re: looking for Database Interface in Haskell

2003-03-03 Thread Steffen Mazanek
Have a look here: http://haskell.cs.yale.edu/haskellDB/ ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Tutorial for literate Haskell

2003-03-03 Thread Steffen Mazanek
Hello. I do Literate Programming this way: At first I define a Latex environment code as verbatim e.g. so: \newenvironment{code}{\footnotesize\verbatim}{\endverbatim\normalsize} This environment is understood by the Haskell compilers. All my modules are own documents concluded in the main

Anyone calculating Nash or Wardrop equilibria in Haskell?

2003-02-28 Thread Steffen Mazanek
someone can give a hint, how to tackle these kinds of problems. Or maybe there are some libraries doing this job. Thanks in advance and best greetings. Steffen Mazanek ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo

Regular expressions as Haskell Type Generators?

2003-02-25 Thread Steffen Mazanek
Hello, I am wondering if it would be worth while (and possible) to allow the definition of types by regular expressions, e.g. data Date = Date #RegExp([0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]) or easier with some auxiliary constructs. Clearly there would be some drawbacks with the use of

O'Haskell

2003-02-07 Thread Steffen Mazanek
Hello. I am toying with the idea of implementing the OHaskell-concepts of Johan Nordlander in the GHC (as a diploma thesis). Simon Marlow adviced me to do some market research in this group and here we go. I am interested in all kinds of comments, advices, scrupulosites... Thanks and

Re: O'Haskell

2003-02-07 Thread Steffen Mazanek
Oh, sorry. I was asked for the link: http://www.math.chalmers.se/~nordland/ohaskell/ Nice greetings, Steffen ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users