This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch.netzwerg | |
import cats.data.Xor | |
import io.circe._ | |
import io.circe.generic.auto._ | |
import io.circe.parser._ | |
import org.scalajs.dom.document | |
import scala.scalajs.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javaslang.collection.Stream; | |
/** | |
* An implementation of https://dierk.gitbooks.io/fregegoodness/content/src/docs/asciidoc/fizzbuzz.html | |
* using http://www.javaslang.io | |
* | |
* @author Rahel Lüthy | |
*/ | |
public class FizzBuzz { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javaslang.collection.Stream; | |
import org.junit.Test; | |
import java.util.concurrent.atomic.AtomicLong; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import static org.junit.Assert.assertEquals; | |
public class ZipWithIndexTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javaslang.collection.List; | |
import org.junit.Test; | |
import java.util.Iterator; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class ZipSpeedTest { | |
private static final java.util.List<String> JAVA_LIST = IntStream.range(0, 1_000_000).mapToObj(String::valueOf).collect(Collectors.toList()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Color exposing (..) | |
import Graphics.Collage exposing (..) | |
import Graphics.Element | |
import Debug exposing (..) | |
type alias Rect = { width: Float, color: Color } | |
toForm : (Rect, Float) -> Form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.Element exposing (..) | |
import Signal exposing (..) | |
import Graphics.Input exposing (hoverable) | |
main : Signal Element | |
main = | |
Signal.map view hover.signal | |
hover : Signal.Mailbox String | |
hover = Signal.mailbox "–" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Color exposing (..) | |
import Graphics.Collage exposing (..) | |
import Graphics.Element exposing (..) | |
import Time exposing (..) | |
import Window | |
import List exposing (..) | |
import Debug | |
-- CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Print where | |
-- Identical to the Haskell version (Print.hs) | |
-- Frege doesn't print line 7 (even a manual stdout.flush afterwards doesn't work) | |
main = do | |
putStrLn "A line with line termination" | |
putStr "A line without line termination, e.g. to prompt for input: " | |
line <- getLine | |
putStrLn ("You entered: " ++ line) |
NewerOlder