A common symbol to use in Scala pattern matching is the right arrow, either ⇒ or =>. So my question is what is the shortcut to type the neat looking right arrow ⇒? I use IntelliJ on Mac OS.
below is an example code that uses ⇒ from https://doc.akka.io/docs/akka/current/guide/tutorial_1.html
package com.lightbend.akka.sample
import akka.actor.{ Actor, Props, ActorSystem }
import scala.io.StdIn
class PrintMyActorRefActor extends Actor {
override def receive: Receive = {
case "printit" ⇒
val secondRef = context.actorOf(Props.empty, "second-actor")
println(s"Second: $secondRef")
}
}
object ActorHierarchyExperiments extends App {
val system = ActorSystem("testSystem")
val firstRef = system.actorOf(Props[PrintMyActorRefActor], "first-actor")
println(s"First: $firstRef")
firstRef ! "printit"
println(">>> Press ENTER to exit <<<")
try StdIn.readLine()
finally system.terminate()
}