Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (16 sloc) 0.441 kb
module Utils where
import Data.List
fromDotted :: String -> [Int]
fromDotted [] = []
fromDotted xs = case break (=='.') xs of
(x,"") -> [read x :: Int]
(x,_:ys) -> (read x :: Int) : fromDotted ys
toDotted :: [Int] -> String
toDotted = joinBy "." . map show
joinBy :: String -> [String] -> String
joinBy = intercalate
split :: Int -> [a] -> [[a]]
split _ [] = []
split n ss = x : split n rest
where
(x,rest) = splitAt n ss
Jump to Line
Something went wrong with that request. Please try again.