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
>>> data M a = M (Proxy M) | |
<interactive>:21:12: error: | |
• Data constructor ‘M’ has existential type variables, a context, or a specialised result type | |
M :: forall k (a :: k) k. Proxy (k -> *) (M k) -> M k a | |
(Use ExistentialQuantification or GADTs to allow this) | |
• In the definition of data constructor ‘M’ | |
In the data type declaration for ‘M’ |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module Main (main) where |
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
% dir=$(mktemp -d); ls .cabal-sandbox/x86_64-linux-ghc-7.8.3-packages.conf.d | grep -P '([\w-]+-[\d.]+)' -o | while read P; do T=$(grep -P '([\w-]+)(?=-[\d.]+)' -o <<< $P); wget --quiet https://hackage.haskell.org/package/$P/$T.cabal -P $dir; done; .cabal-sandbox/bin/outdated $dir/*.cabal; rm -rf $dir | |
Loading the index..... | |
‘/tmp/tmp.OAtczPmde5/blaze-builder.cabal’ has outdated dependencies against ‘linux;x86_64;ghc-7.8;’: | |
- library | |
the version range of ‘text’ (>=0.10 && <1.2) does not include the latest version 1.2.0.0 | |
‘/tmp/tmp.OAtczPmde5/case-insensitive.cabal’ has outdated dependencies against ‘linux;x86_64;ghc-7.8;’: | |
- library | |
the version range of ‘text’ (>=0.3 && <1.2) does not include the latest version 1.2.0.0 | |
- test-suite ‘test-case-insensitive’ | |
the version range of ‘text’ (>=0.3 && <1.2) does not include the latest version 1.2.0.0 |
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
newtype FromJSON_ a = FromJSON_ { _parseJSON :: Value -> Parser a } | |
newtype T a s = T { unT :: a } | |
instance Reifies s (FromJSON_ a) => FromJSON (T a s) where | |
parseJSON = fmap T . _parseJSON (reflect (Proxy :: Proxy s)) | |
parseJson :: forall a. (Value -> Parser a) -> ByteString -> Maybe a | |
parseJson f b = reify (FromJSON_ f) (\(_ :: Proxy s) -> fmap unT ((decode :: ByteString -> Maybe (T a s)) b)) |
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 ruby | |
def with_sobachka(str, &block) | |
puts "Sobachka!" | |
block.call | |
end | |
if $0 == __FILE__ | |
with_sobachka(<<-SOBACHKA) do | |
Eblo = 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
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE EmptyCase #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeFamilies #-} |
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
class I | |
attr_accessor :name | |
def initialize(name) | |
self.name = name | |
end | |
end | |
class D < I | |
attr_accessor :children |
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 bash | |
set -o errexit | |
fun-global () | |
{ | |
FOO=$(exit 1) | |
echo "fun-global: this won't be printed" | |
} |
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
module LazyPatterns where | |
import Control.Lens | |
{-# ANN module "HLint: ignore Use camelCase" #-} | |
data T = C { _x :: Int, _y :: Char } deriving (Show, Eq) | |
-- | |
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
module Main (main) where | |
import Control.Applicative | |
import Control.Monad | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString as ByteString | |
import qualified Data.ByteString.Char8 as ByteString (readInt) | |
import qualified Data.ByteString.Unsafe as ByteString | |
import qualified Data.HashMap.Strict as Map | |
import Data.Char (ord) |
NewerOlder