Skip to content

Instantly share code, notes, and snippets.

module Main where
import Control.Applicative
import Control.Monad
import Data.HashSet hiding (filter, map)
import Data.Maybe
dictionary :: IO (HashSet String)
dictionary = (fromList . lines) <$> readFile "/usr/share/dict/words"
module Main where
import Control.Applicative hiding (empty)
import Data.HashMap.Strict hiding (map)
import Data.String.Utils
data Entry = Entry String String
run :: FilePath -> FilePath -> IO ()
run input output = process <$> readFile input >>= writeFile output
module Main where
import Control.Applicative hiding (empty)
import Data.HashMap.Strict hiding (map)
import Data.String.Utils
data Entry = Entry { _postcode :: String, _person :: String }
run :: FilePath -> FilePath -> IO ()
run input output = writeFile output =<< process <$> readFile input
module Main where
import Control.Applicative hiding (empty)
import Data.HashMap.Strict hiding (map)
import Data.String.Utils
data Entry = Entry { _postcode :: String, _person :: String }
run :: FilePath -> FilePath -> IO ()
run input output = writeFile output =<< process <$> readFile input
module Main where
import Control.Applicative hiding (empty)
import Data.HashMap.Strict hiding (map)
import Data.String.Utils
data Entry = Entry { _postcode :: String, _person :: String }
run :: FilePath -> FilePath -> IO ()
run input output = writeFile output =<< process <$> readFile input
module Main where
import Control.Applicative
import Control.Monad
import Data.HashSet hiding (filter, map)
import Data.Maybe
dictionary :: IO (HashSet String)
dictionary = (fromList . lines) <$> readFile "/usr/share/dict/words"
module Test where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
id : {A : Set} → A → A
id a = a
data Bool : Set where
template<typename T>
void eraseElem(std::list<T>* elements, const T& elem) {
for (auto it = elements->begin(); it != elements->end(); it++) {
if (*it == elem) {
elements->erase(it);
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
def _isotonic_regression(np.ndarray[DOUBLE, ndim=1] y,
np.ndarray[DOUBLE, ndim=1] weight,
np.ndarray[DOUBLE, ndim=1] solution):
cdef:
Py_ssize_t current, i
unsigned int len_active_set