0

I've successfully added scalaz to scala repl (2.9.1) and tried some basic examples with no problem, like : List(10, 20, 30) <*> (List(1, 2, 3) map ((_: Int) * (_: Int)).curried)

or

List(10, 20, 30) |@| List(1, 2, 3) apply (_ * _)

However, the alias for map, namely °, as seen in this example http://scalaz.github.com/scalaz/scalaz-2.9.1-6.0.4/doc.sxr/scalaz/example/ExampleApplicative.scala.html#23569

is not recognized, I got a

error: value ° is not a member of List[Int]

Maybe I'm using the wrong character ? A copy-paste from the example above gobble the special characters...

Any guidance would be greatly appreciated ! :)

M'λ'
  • 651
  • 9
  • 21

1 Answers1

4

Yes, you are indeed using the wrong character. It is not °.

scala> val f: Int => String = _.toString
f: Int => String = <function1>

scala> List(1,2) ∘ f
res2: List[String] = List(1, 2)

edit: Is your encoding in terminal and java set to UTF8?

drexin
  • 24,225
  • 4
  • 67
  • 81
  • Haem, well I suspected that ... but how am I supposed to type ∘ on my keyboard ?:) – M'λ' Jun 13 '12 at 10:28
  • I think you have to install a unicode key mapping to do so. I don't know of another way to insert unicode characters without copy pasting them ;-) – drexin Jun 13 '12 at 10:41
  • @M'λ' If you're using emacs, I have a small mode, you can use for this purpose: https://github.com/folone/emacs-scalaz-unicode-input-method – George Jul 07 '12 at 21:05