This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Applicative Programming, Disjoint Unions, Semigroups and Non-breaking Error Handling

3 replies
Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.

Hello,
I delivered a talk recently to Brisbane Functional Programming Group
http://www.meetup.com/Brisbane-Functional-Programming-Group-BFG/ The
title of the talk was Applicative Programming, Disjoint Unions,
Semigroups and Non-breaking Error Handling which ran for 45 minutes. I
used Scala as the presentation language, but the slides contain an
appendix with runnable Haskell, C# and Java examples. I thought
[scala-user] might find the slides interesting although no video/audio
was recorded.

You can view the slides in a variety of formats at
http://applicative-errors-scala.googlecode.com/svn/artifacts/0.6/ or you
can download an archive containing all formats at
http://files.meetup.com/1443989/applicative-errors-scala.tar.gz

I'm happy to answer any questions on the list if you find the topic
interesting.

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: Applicative Programming, Disjoint Unions, Semigroups and N

Hi Tony,

I really liked the slides, but I think it would be useful to define
"non breaking" error handling, as I hadn't heard this term before. My
understanding is as follows.

"Breaking" error handling only reports the first error encountered.
This is often implemented with exceptions in languages that support
them. "Non breaking" reports as many errors as possible in one pass.
It is commonly used in web form validation.

-jason

On Fri, Apr 23, 2010 at 9:12 AM, Tony Morris wrote:
> Hello,
> I delivered a talk recently to Brisbane Functional Programming Group
> http://www.meetup.com/Brisbane-Functional-Programming-Group-BFG/ The
> title of the talk was Applicative Programming, Disjoint Unions,
> Semigroups and Non-breaking Error Handling which ran for 45 minutes. I
> used Scala as the presentation language, but the slides contain an
> appendix with runnable Haskell, C# and Java examples. I thought
> [scala-user] might find the slides interesting although no video/audio
> was recorded.
>
> You can view the slides in a variety of formats at
> http://applicative-errors-scala.googlecode.com/svn/artifacts/0.6/ or you
> can download an archive containing all formats at
> http://files.meetup.com/1443989/applicative-errors-scala.tar.gz
>
> I'm happy to answer any questions on the list if you find the topic
> interesting.
>
> --
> Tony Morris
> http://tmorris.net/
>
>
>

Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Applicative Programming, Disjoint Unions, Semigroups and No

Thanks Jason for the feedback. I agree this term may need some elaboration.

Jason Zaugg wrote:
> Hi Tony,
>
> I really liked the slides, but I think it would be useful to define
> "non breaking" error handling, as I hadn't heard this term before. My
> understanding is as follows.
>
> "Breaking" error handling only reports the first error encountered.
> This is often implemented with exceptions in languages that support
> them. "Non breaking" reports as many errors as possible in one pass.
> It is commonly used in web form validation.
>
> -jason
>
> On Fri, Apr 23, 2010 at 9:12 AM, Tony Morris wrote:
>
>> Hello,
>> I delivered a talk recently to Brisbane Functional Programming Group
>> http://www.meetup.com/Brisbane-Functional-Programming-Group-BFG/ The
>> title of the talk was Applicative Programming, Disjoint Unions,
>> Semigroups and Non-breaking Error Handling which ran for 45 minutes. I
>> used Scala as the presentation language, but the slides contain an
>> appendix with runnable Haskell, C# and Java examples. I thought
>> [scala-user] might find the slides interesting although no video/audio
>> was recorded.
>>
>> You can view the slides in a variety of formats at
>> http://applicative-errors-scala.googlecode.com/svn/artifacts/0.6/ or you
>> can download an archive containing all formats at
>> http://files.meetup.com/1443989/applicative-errors-scala.tar.gz
>>
>> I'm happy to answer any questions on the list if you find the topic
>> interesting.
>>
>> --
>> Tony Morris
>> http://tmorris.net/
>>
>>
>>
>>

Luc Duponcheel
Joined: 2008-12-19,
User offline. Last seen 34 weeks 3 days ago.
Re: Applicative Programming, Disjoint Unions, Semigroups and N
I'd rather call it "accumulative error handling"

I also have this feeling that Monoidal Functors
M[A] => M[B] => M[(A, B)]
(essentially the same as Applicative Functors)
are more elegant to use here:
assuming that E is Monoid
[ corner case of a Monoidal Functor ]
V[(E, A)] => V[(E,B)] => V[(E,(A,B))]
either accumulates successful results using (,)
or accumulates errors in E

Your example is, probably an instance
of a more general fact:
the composition of Applicative (Monoidal) Functors
is again an Applicative (Monoidal) Functor
(using a Monoid for one of them).

ps: this gact is not true (in general) for Monads

... just a thought ...


Luc



On Fri, Apr 23, 2010 at 9:40 AM, Tony Morris <tonymorris@gmail.com> wrote:
Thanks Jason for the feedback. I agree this term may need some elaboration.

Jason Zaugg wrote:
> Hi Tony,
>
> I really liked the slides, but I think it would be useful to define
> "non breaking" error handling, as I hadn't heard this term before. My
> understanding is as follows.
>
> "Breaking" error handling only reports the first error encountered.
> This is often implemented with exceptions in languages that support
> them. "Non breaking" reports as many errors as possible in one pass.
> It is commonly used in web form validation.
>
> -jason
>
> On Fri, Apr 23, 2010 at 9:12 AM, Tony Morris <tonymorris@gmail.com> wrote:
>
>> Hello,
>> I delivered a talk recently to Brisbane Functional Programming Group
>> http://www.meetup.com/Brisbane-Functional-Programming-Group-BFG/ The
>> title of the talk was Applicative Programming, Disjoint Unions,
>> Semigroups and Non-breaking Error Handling which ran for 45 minutes. I
>> used Scala as the presentation language, but the slides contain an
>> appendix with runnable Haskell, C# and Java examples. I thought
>> [scala-user] might find the slides interesting although no video/audio
>> was recorded.
>>
>> You can view the slides in a variety of formats at
>> http://applicative-errors-scala.googlecode.com/svn/artifacts/0.6/ or you
>> can download an archive containing all formats at
>> http://files.meetup.com/1443989/applicative-errors-scala.tar.gz
>>
>> I'm happy to answer any questions on the list if you find the topic
>> interesting.
>>
>> --
>> Tony Morris
>> http://tmorris.net/
>>
>>
>>
>>


--
Tony Morris
http://tmorris.net/





--
  __~O
 -\ <,
(*)/ (*)

reality goes far beyond imagination

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland