Sha256: 08d86dbe34ad89852637207d4ae2091a5346b9e62ff2002cd844570f1980fcdf

Contents?: true

Size: 552 Bytes

Versions: 387

Compression:

Stored size: 552 Bytes

Contents

import scala.util.parsing.combinator.RegexParsers

object Sgf extends RegexParsers {

  type Tree[A] = Node[A] // to separate the type from the constructor, cf. Haskell's Data.Tree
  type Forest[A] = List[Tree[A]]
  case class Node[A](rootLabel: A, subForest: Forest[A] = List())

  // A tree of nodes.
  type SgfTree = Tree[SgfNode]

  // A node is a property list, each key can only occur once.
  // Keys may have multiple values associated with them.
  type SgfNode = Map[String, List[String]]

  def parseSgf(text: String): Option[SgfTree] = ???
}

Version data entries

387 entries across 387 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.179 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.178 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.177 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.176 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.175 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.174 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.173 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.172 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.171 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.170 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.169 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.167 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.166 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.165 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.164 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.163 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.162 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.161 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala
trackler-2.2.1.160 tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala