- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Applicative Programming, Disjoint Unions, Semigroups and Non-breaking Error Handling
Fri, 2010-04-23, 08:13
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.
Fri, 2010-04-23, 08:57
#2
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/
>>
>>
>>
>>
Fri, 2010-04-23, 09:07
#3
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:
--
__~O
-\ <,
(*)/ (*)
reality goes far beyond imagination
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
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/
>
>
>