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 Data.List | |
import Control.Monad | |
most :: [Int] -> Int | |
most ns = let | |
fs :: [[Int]] | |
fs = group . sort . map (\n -> read [head . show $ n]) $ ns | |
foo acc nn = case (fst acc `compare` length nn, snd acc `compare` head nn) of | |
(GT, _) -> (length nn, head nn) |
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 Foundation | |
#if os(Linux) | |
import SwiftGlibc | |
SwiftGlibc.srandom(UInt32(time(nil))) | |
public func arc4random_uniform(_ max: UInt32) -> Int32 { | |
return (SwiftGlibc.rand() % Int32(max-1)) | |
} | |
#endif |
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 Foundation | |
#if os(Linux) | |
import SwiftGlibc | |
SwiftGlibc.srandom(UInt32(time(nil))) | |
public func arc4random_uniform(_ max: UInt32) -> Int32 { | |
return (SwiftGlibc.rand() % Int32(max-1)) | |
} | |
#endif |
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 Foundation | |
#if os(Linux) | |
import SwiftGlibc | |
SwiftGlibc.srandom(UInt32(time(nil))) | |
public func arc4random_uniform(_ max: UInt32) -> Int32 { | |
return (SwiftGlibc.rand() % Int32(max-1)) | |
} |
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
#!/usr/bin/env stack | |
-- stack --resolver lts-13.21 --install-ghc runghc --package pandoc --package pandoc-types | |
{-# OPTIONS_GHC -Wall #-} | |
import Text.Pandoc | |
import Text.Pandoc.JSON | |
import Data.Foldable | |
import Debug.Trace |
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
let Prelude = ./Prelude.dhall | |
let TypeName | |
: Type | |
= Text | |
let ColumnName | |
: Type | |
= Text |