Skip to content

Instantly share code, notes, and snippets.

View risingBirdSong's full-sized avatar

peter risingBirdSong

  • PNW
View GitHub Profile
@dino-
dino- / string-conversions.hs
Last active April 13, 2025 04:38
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@davenportw15
davenportw15 / WordCounter.hs
Created July 14, 2015 03:25
Map counter in Haskell
import Data.Map (Map)
import qualified Data.Map as Map
import Control.Monad
-- | Returns a Map with counts of items in a list
count :: (Ord a, Integral b) => [a] -> Map a b
count =
foldr updateMap Map.empty
where updateMap v counts
| Map.member v counts = Map.adjust succ v counts