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

Option...aly bored

52 replies
Chris Marshall
Joined: 2009-06-17,
User offline. Last seen 44 weeks 3 days ago.
RE: Option...aly bored
This is great news. I had already taken Jason's advice to investigate the examples...
    val f = ☆((n: Int) => if (n % 2 == 0) None else Some((n + 1).toString))
      val g = ☆((s: String) => if (List(5, 7) ∃ (_ == s.length)) None else Some("[" + s + "]"))
   (List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map (f >=> g apply _)) assert_≟ List(Some("[8]"), None, None, Some("[100]")
...I didn't get very far!

I gave a presentation recently on scala and found the following approach pretty useful (might be useful in this space as well):

1. Describe some simple problem
2. Solve the problem in Java (or imperative-style scala)
3. Iterate thru a few solutions introducing a few new Scala concepts at a time, ending up with something which can then be compared side-by-side with the original code to highlight clarity/compactness etc.

Also a description of who the audience for scalaz is: do you think it could provide useful abstractions for programmers "in the enterprise", or is it squarely aimed at academia?

Cheers, Chris

Date: Fri, 25 Dec 2009 14:28:16 +0100
Subject: Re: [scala-user] Option...aly bored
From: chris [dot] twiner [at] gmail [dot] com
To: tonymorris [at] gmail [dot] com
CC: scala-user [at] listes [dot] epfl [dot] ch; oxbow_lakes [at] hotmail [dot] com

I for one would invest in many a repeat read. Tuned and eagerly awaiting. (Not quite salivating but not far off)

On Dec 25, 2009 1:46 AM, "Tony Morris" <tonymorris [at] gmail [dot] com> wrote:

I am strongly considering writing a "user manual" to appease this problem. Stay tuned. Tony Morris http://tmorris.net/
On Dec 25, 2009, at 12:38 AM, christopher marshall <oxbow_lakes [at] hotmail [dot] com> wrote: > > Date: Thu,...


Have more than one Hotmail account? Link them together to easily access both.
Mohamed Bana 2
Joined: 2009-10-21,
User offline. Last seen 42 years 45 weeks ago.
Re: Option...aly bored
I wonder how many people have watched Barbara Liskov's talk.  She gives her opinion on DSLs

http://www.infoq.com/presentations/liskov-power-of-abstraction;jsessionid=34B5245D85D5278FB95ED6B0A4A24B68



—Mohamed
On 29/12/09 12:33, christopher marshall wrote:
COL109-W103C81A3DABBCF9AB51D208D7A0 [at] phx [dot] gbl" type="cite">
This is great news. I had already taken Jason's advice to investigate the examples...
    val f = ☆((n: Int) => if (n % 2 == 0) None else Some((n + 1).toString))      val g = ☆((s: String) => if (List(5, 7) ∃ (_ == s.length)) None else Some("[" + s + "]"))   (List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map (f >=> g apply _)) assert_≟ List(Some("[8]"), None, None, Some("[100]")...I didn't get very far!

I gave a presentation recently on scala and found the following approach pretty useful (might be useful in this space as well):

1. Describe some simple problem
2. Solve the problem in Java (or imperative-style scala)
3. Iterate thru a few solutions introducing a few new Scala concepts at a time, ending up with something which can then be compared side-by-side with the original code to highlight clarity/compactness etc.

Also a description of who the audience for scalaz is: do you think it could provide useful abstractions for programmers "in the enterprise", or is it squarely aimed at academia?

Cheers, Chris

Date: Fri, 25 Dec 2009 14:28:16 +0100
Subject: Re: [scala-user] Option...aly bored
From: chris [dot] twiner [at] gmail [dot] com
To: tonymorris [at] gmail [dot] com
CC: scala-user [at] listes [dot] epfl [dot] ch; oxbow_lakes [at] hotmail [dot] com

I for one would invest in many a repeat read. Tuned and eagerly awaiting. (Not quite salivating but not far off)


On Dec 25, 2009 1:46 AM, "Tony Morris" tonymorris [at] gmail [dot] com (<tonymorris [at] gmail [dot] com>) wrote:

I am strongly considering writing a "user manual" to appease this problem. Stay tuned.


Tony Morris
http://tmorris.net/



On Dec 25, 2009, at 12:38 AM, christopher marshall oxbow_lakes [at] hotmail [dot] com (<oxbow_lakes [at] hotmail [dot] com>) wrote:

  
Date: Thu,...
      
 		 	   		  
_________________________________________________________________
Add your Gmail and Yahoo! Mail email accounts into Hotmail - it's easy
http://clk.atdmt.com/UKM/go/186394592/direct/01/

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