Применить функцию к каждому элементу списка - это просто:
map _ [] = []
map f (x:xs) = f x : map f xs
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
# Put this file into `~/.config/nixpkgs/overlays/idea.nix`. | |
# Then, install IDEA with `nix-env -iA nixos.idea-community`. | |
self: super: | |
{ | |
jbsdk = super.callPackage ~/config/nix/jbsdk.nix {}; # you might need to override this path. | |
idea-community = let | |
version = "2017.2.3"; |
-- stack --resolver=lts-10.5 script | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE Rank2Types #-} | |
module Write where | |
import Codec.Xlsx | |
import Control.Lens | |
import Control.Monad.State.Strict |
Requirements:
git rev-parse --show-toplevel
)Tree:
.
├── .git
Someone asked whether or not acid-state
was production ready. I shared my experiences:
parsonsmatt [11:32 AM] @nikolap it's used by cardano-wallet and Hackage. Based on my experience with acid-state, I'd say it is not a good choice for production data storage. For local desktop apps, SQLite is a much better choice, and for real production apps, Postgresql is king.
parsonsmatt [11:44 AM] acid-state did not have a test suite, at all, until I implemented the very first tests (for TemplateHaskell code generation) earlier this year. It has picked up some tests since then, but I'm still not confident in it's correctness.
It claims to be resilient to unplugging the power cord, but I doubt that, as it's not resilient to Ctrl-C
: acid-state/acid-state#79
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PartialTypeSignatures #-} | |
{-# LANGUAGE ParallelListComp #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE DisambiguateRecordFields #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} |