haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] Haskell and the Software design process

Subject: Re: [Haskell-cafe] Haskell and the Software design process
From: aditya siram
Date: Mon, 3 May 2010 00:17:18 -0400
I'm a little confused about this too. I've seen many functions defined like:
f x = (\s -> ...)
which is a partial function because it returns a function and is the same as:
f x s = ...

Off the top of my head the State monad makes extensive use if this
style. Is this bad?

- deech





On 5/2/10, Bradford Larsen <brad.larsen@xxxxxxxxx> wrote:
> On Sun, May 2, 2010 at 9:18 PM, Edgar Z. Alvarenga <edgar@xxxxxxxxxx> wrote:
>> On Sun, 02/May/2010 at 13:10 -0700, Don Stewart wrote:
>>
>>>     * Avoid partial functions
>>
>> Why?
>>
>> Edgar
>
> Ever place you use a partial function, you need to verify that its
> usage is in fact safe.  Otherwise, you risk pattern match failures,
> undefined, nontermination, and other types of nasties.
>
> If you can structure your code so none of your functions are partial,
> verification that their usage is safe is a whole lot easier.  :-)
>
> Brad
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@xxxxxxxxxxx
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>