Skip to content

Instantly share code, notes, and snippets.

benchmarking 5 elements/sumOfTwo
time 13.12 ns (12.95 ns .. 13.32 ns)
0.999 R² (0.998 R² .. 0.999 R²)
mean 13.12 ns (12.95 ns .. 13.31 ns)
std dev 573.7 ps (433.1 ps .. 769.1 ps)
@fishyFrogFace
fishyFrogFace / Main.hs
Last active April 14, 2019 12:03
Read from file
import System.Environment (getArgs)
doStuffToFile :: String -> IO ()
doStuffToFile str = print $ length str
-- alt1: "stack build" så "stack exec <projectname>-exe path-to-file-if-not-in-folder/bible.txt"
main :: IO ()
main = do
args <- getArgs
case args of
@fishyFrogFace
fishyFrogFace / parseEncoding.hs
Created April 13, 2019 14:13
Example of reading and writing to files with custom encoding
import System.IO
import Control.Applicative (liftA)
import Data.Foldable (for_)
import Control.DeepSeq (($!!))
writeFileWithEncoding :: FilePath -> String -> IO ()
writeFileWithEncoding fp content =
withFile fp WriteMode $ \h ->
hSetEncoding h utf8 >>
hPutStr h content
@fishyFrogFace
fishyFrogFace / README-Template.md
Created October 20, 2018 17:36 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@fishyFrogFace
fishyFrogFace / CalendarView.java
Created October 1, 2016 16:00 — forked from james-d/CalendarView.java
Simple demo of creating a appointment-calendar like view (similar to the default calendar view in Google Calendar), in JavaFX 8. Just manages selection of time slots in the grid.
package calendarview;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;