code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE CPP #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Typed deep embedding of simple C expressions
--
-- This is a subset of C expressions that only have simple non-compound and
-- non-pointed types, and that don't contain any control structures.
--
-- (Of course, nothing stops one fr... | kmate/imperative-edsl | src/Language/Embedded/CExp.hs | bsd-3-clause | 16,823 | 0 | 14 | 4,809 | 6,746 | 3,353 | 3,393 | -1 | -1 |
--------------------------------------------------------------------------------
-- | Pretty print LLVM IR Code.
--
module Llvm.PpLlvm (
-- * Top level LLVM objects.
ppLlvmModule,
ppLlvmComments,
ppLlvmComment,
ppLlvmGlobals,
ppLlvmGlobal,
ppLlvmAliases,
ppLlvmAlias,
ppLlvmMetas,
... | ekmett/ghc | compiler/llvmGen/Llvm/PpLlvm.hs | bsd-3-clause | 16,451 | 0 | 18 | 4,659 | 4,502 | 2,199 | 2,303 | 298 | 14 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE CPP, MagicHash, UnboxedTuples #-}
-------------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2007
--
-- | Break Arrays
--
-- An array of bytes, indexed by a breakpoint number (breakpointId in Tickish)
-- ... | sdiehl/ghc | libraries/ghci/GHCi/BreakArray.hs | bsd-3-clause | 3,479 | 0 | 20 | 850 | 1,009 | 508 | 501 | 80 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module ParseSystem where
import ClassyPrelude hiding (throwM)
import Data.Attoparsec.ByteString.Char8 hiding (take)
import qualified Data.Attoparsec.Types as A
import StreamParser
import Data.Time hiding (readTime)
... | limaner2002/EPC-tools | plots/src/ParseSystem.hs | bsd-3-clause | 1,274 | 0 | 19 | 259 | 396 | 208 | 188 | 33 | 3 |
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE DeriveAnyClass, StandaloneDeriving, DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}
{-# OPTIONS_GHC -fwarn-incomplete-uni-patterns #-}
module Day11 where
import Test.Hspec
import Control.Monad (guard)
import Data.List
impor... | guibou/AdventOfCode2016 | src/Day11.hs | bsd-3-clause | 5,409 | 0 | 17 | 1,352 | 1,817 | 937 | 880 | 103 | 2 |
-- Run all tests for the Haskell CnC Runtime System.
import System.Directory
import qualified Intel.Cnc
import qualified Intel.CncPure
import qualified Intel.CncUtil
import System.Cmd(system)
import System.Exit
import HSH
import Test.HUnit
import Data.String.Utils -- from MissingH package
main = do
cd <- getC... | rrnewton/Haskell-CnC | runAllTests.hs | bsd-3-clause | 3,241 | 32 | 10 | 682 | 531 | 285 | 246 | 51 | 5 |
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Beba.Options as Beba
import qualified Beba.Env as Beba
import qualified Beba.Process as Beba
import Options.Applicative
import Data.Semigroup ((<>))
import Data.Version (showVersion)
import Data.Maybe
import qualified Paths_beba_parallel as P
... | awgn/beba-parallel | src/Main.hs | bsd-3-clause | 3,407 | 2 | 16 | 913 | 1,083 | 554 | 529 | 73 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
-- | Main stack tool entry point.
module Main where
import... | meiersi-11ce/stack | src/main/Main.hs | bsd-3-clause | 42,246 | 0 | 30 | 15,675 | 8,503 | 4,310 | 4,193 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Language.Pylon.Core.CaseTree
-- Copyright : (c) 2014 Lukas Heidemann
-- License : BSD
-- Maintainer : lukasheidemann@gmail.com
-- Stability : experimental
-- Portability : ghc
--
-- Left hand side pattern mat... | zrho/pylon | src/Language/Pylon/Core/CaseTree.hs | bsd-3-clause | 6,909 | 0 | 17 | 1,223 | 1,678 | 891 | 787 | 106 | 1 |
{-# LANGUAGE GADTs #-}
module LearningGADTS () where
data Expr a where
I :: Int -> Expr Int
B :: Bool -> Expr Bool
Add :: Expr Int -> Expr Int -> Expr Int
Mul :: Expr Int -> Expr Int -> Expr Int
Eq :: Expr Int -> Expr Int -> Expr Bool
eval :: Expr a -> a
eval (I n) = n
eval (B b) = b
eval (Add e1 ... | steveshogren/language-safety-data-collector | src/learningGADTS.hs | bsd-3-clause | 419 | 0 | 8 | 123 | 221 | 108 | 113 | 14 | 1 |
module Eclogues.APIElectionSpec (spec) where
import Eclogues.API (parseZKData)
import Eclogues.APIElection (advertisedData)
import Test.Hspec
import Test.QuickCheck (property)
{-# ANN module ("HLint: ignore Use ." :: String) #-}
spec :: Spec
spec = describe "advertisedData" $
it "is the inverse of parseZKData" ... | futufeld/eclogues | eclogues-impl/test/Eclogues/APIElectionSpec.hs | bsd-3-clause | 408 | 0 | 10 | 69 | 112 | 64 | 48 | 10 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP
, NoImplicitPrelude
, ExistentialQuantification
, AutoDeriveTypeable
#-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module ... | spacekitteh/smcghc | libraries/base/GHC/IO/Handle/Types.hs | bsd-3-clause | 16,345 | 0 | 13 | 3,711 | 1,350 | 811 | 539 | 135 | 1 |
module Boids where
import Data.List
type DeltaTime = Double
newtype Vec = V { unVec :: (Double, Double) } deriving (Eq, Ord)
instance Show Vec where
show (V p) = show p
instance Num Vec where
(V (a, b)) + (V (x, y)) = V (a + x, b + y)
negate (V (a, b)) = V (negate a, negate b)
fromInteger a = scale (fromInt... | MaximilianAlgehed/Boids | src/Boids.hs | bsd-3-clause | 3,229 | 0 | 16 | 898 | 1,569 | 835 | 734 | 83 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
{-| Make Type (see "AST") an instance of @Translatable@ (see
"CodeGen.Typeclasses"). -}
module CodeGen.Type where
import CodeGen.Typeclasses
import CodeGen.CCodeNames
import CCode.Main
import CCode.PrettyCCode ()
import qualified Types as Ty
translatePrimi... | Paow/encore | src/back/CodeGen/Type.hs | bsd-3-clause | 2,879 | 0 | 10 | 766 | 966 | 433 | 533 | -1 | -1 |
{-# LANGUAGE LambdaCase #-}
module Database.Concelo.TrieLike
( TrieLike(value, member, foldrPairs, foldrPaths) ) where
import qualified Database.Concelo.Path as P
class TrieLike t where
value :: t k v -> Maybe v
member :: Ord k => P.Path k v0 -> t k v -> Bool
foldrPairs :: ((k, t k v) -> b -> b) -> b -> t k v... | Concelo/concelo | src/Database/Concelo/TrieLike.hs | bsd-3-clause | 633 | 0 | 13 | 157 | 300 | 157 | 143 | 19 | 0 |
module Buzz
( speed
) where
import Data.ByteString ( ByteString )
import Criterion.Main ( bgroup, bench, nf, Benchmark )
import Algorithm.OptimalBlocks.BuzzHash ( hashes, h )
speed :: ByteString -> [Benchmark]
speed bytes =
[ bgroup "BuzzHash"
[ bgroup "h" $
[ bench (show n) (nf h n) | n <- 0:[7,1... | tsuraan/optimal-blocks | benches/Buzz.hs | bsd-3-clause | 444 | 0 | 13 | 117 | 187 | 103 | 84 | 12 | 1 |
-------------------------------------------------------------------------------
-- |
-- Module : Text.SmallCaps.ConfigParser
-- Copyright : (c) Stefan Berthold 2014-2015
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : stefan.berthold@gmx.net
-- Stability : unstable
-- Portability : GHC
--
-... | ZjMNZHgG5jMXw/smallcaps | src/smallcaps/Text/SmallCaps/ConfigParser.hs | bsd-3-clause | 8,808 | 0 | 15 | 1,794 | 2,995 | 1,555 | 1,440 | 165 | 2 |
{-# Language CPP #-}
module CopySpec ( copySpec ) where
import TestInit
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( FilePath, catch)
#else
import Prelude hiding ( FilePath)
#endif
import Control.Monad (forM_)
import System.IO.Error
import Help
copySpec :: Spec
copySpec = do
... | adinapoli/Shelly.hs | test/src/CopySpec.hs | bsd-3-clause | 2,180 | 0 | 21 | 852 | 650 | 287 | 363 | 73 | 1 |
module Language.Induction (runDerive, getInd) where
import Language.Syntax
import Language.PrettyPrint
import Control.Monad.Reader
import Control.Monad.Identity
import Control.Monad.State.Lazy
import Data.List
import Data.Char
-- take in a inductive set def and return
-- rename a set var in formula
rename :: PreTe... | Fermat/Gottlob | Language/Induction.hs | bsd-3-clause | 3,318 | 1 | 21 | 814 | 1,452 | 753 | 699 | 72 | 4 |
module Data.Powermap where
import qualified Data.Map as M
import Control.Applicative
import Data.Binary
import Data.Text (Text, pack, unpack)
newtype Powermap = Powermap { getPowermap :: M.Map Vertex OutE } deriving Show
type OutE = [Vertex]
type Vertex = Text
instance Binary Powermap where
put = put . getPowe... | awagner83/powermap | src/Data/Powermap.hs | bsd-3-clause | 1,105 | 0 | 10 | 236 | 340 | 194 | 146 | 26 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-}
module PropertyGeneric ( genericTests ) where
import Prelude.Compat
#if !MIN_VERSION_base(4,16,0)
import Data.Semigroup (Option(..))
#endif
import Encoders
import Instances ()
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.QuickCheck (testProperty)
#... | dmjio/aeson | tests/PropertyGeneric.hs | bsd-3-clause | 6,293 | 0 | 18 | 1,144 | 907 | 495 | 412 | 90 | 1 |
module GameObject where
import Graphics.Rendering.OpenGL
import Data.IORef
import Textures
-------------------------------------------------------------
data GameObject = GameObject {
location :: IORef (GLfloat, GLfloat, GLfloat)
--rotation :: IORef (GLfloat, GLfloat, GLfloat),
--textures :: IORef [Mayb... | gbluma/opengl1 | src/GameObject.hs | bsd-3-clause | 579 | 0 | 11 | 109 | 105 | 63 | 42 | 11 | 1 |
{-# LANGUAGE RecordWildCards, MultiParamTypeClasses #-}
module Network.ZDNS.Util where
import Data.Tuple (swap)
import Data.Maybe (fromJust, fromMaybe)
import Data.Bits
import System.Random (getStdRandom, randomR)
import Data.Word
import Data.Bits (shiftL)
import Data.List (intersperse)
-- | A mapper from type to In... | ben-han-cn/hdns | Network/ZDNS/Util.hs | bsd-3-clause | 1,925 | 0 | 14 | 454 | 791 | 424 | 367 | 49 | 1 |
-------------------------------------------------------------------------
--
-- Haskell: The Craft of Functional Programming, 3e
-- Simon Thompson
-- (c) Addison-Wesley, 1996-2011.
--
-- Chapter 17
--
-- Lazy programming.
--
-------------------------------------------------------------------------
-- Lazy pr... | Numberartificial/workflow | snipets/src/Craft/Chapter17.hs | mit | 8,565 | 0 | 11 | 2,243 | 2,896 | 1,629 | 1,267 | 151 | 1 |
module Data.Aeson.Config
( load
) where
import qualified Control.Lens as Lens
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Trans.FastWriter (WriterT)
import qualified Control.Monad.Trans.FastWriter as Writer
import Data.Aeson (FromJSON(..), Result(..), eitherDe... | lamdu/lamdu | src/Data/Aeson/Config.hs | gpl-3.0 | 1,668 | 0 | 13 | 406 | 515 | 286 | 229 | -1 | -1 |
import CPi.Lib
import Tests
import CPi.ODE
import CPi.Matlab
import CPi.Semantics
import CPi.Logic
import CPi.Signals
import System.Environment (getArgs)
-- Time points
--tps = (100,(0,25))
-- Basic
f1 = Pos (0,25) (ValGT (Conc (Def "P" [])) (R 0.05))
f2 = Pos (0,25) (ValLE (Conc (Def "S" ["s"])) (R 0.01))
f3 = Nec ... | continuouspi/cpiwb | profileSig3.hs | gpl-3.0 | 9,004 | 0 | 13 | 3,623 | 2,992 | 1,483 | 1,509 | 242 | 1 |
{-# LANGUAGE MagicHash,
UnboxedTuples,
ScopedTypeVariables #-}
module UU.Scanner.GenTokenParser where
import GHC.Base
import UU.Parsing.Interface(IsParser(pCostSym, pSym), (<$>))
import UU.Scanner.GenToken(GenToken(..))
import UU.Scanner.Position(Pos, noPos)
pCostReserved' :: I... | UU-ComputerScience/uulib | src/UU/Scanner/GenTokenParser.hs | bsd-3-clause | 2,505 | 0 | 12 | 1,151 | 736 | 367 | 369 | -1 | -1 |
module Pure (module Export) where
-- from pure-core
import Pure.Data.View as Export hiding (On,content)
import Pure.Data.View.Patterns as Export
-- from pure-default
import Pure.Data.Default as Export
-- from pure-dom
import Pure.DOM as Export
-- from pure-lifted
import Pure.Data.Lifted as Export (JSV,Win(..),Doc(.... | grumply/nuclear | src/Pure.hs | bsd-3-clause | 1,276 | 0 | 6 | 118 | 403 | 285 | 118 | 15 | 0 |
blank :: Int -> Int -> [String]
blank x y = replicate x $ replicate y '_'
vertical :: Int -> [String]
vertical n = replicate n (replicate n '_' ++ ['1'] ++ replicate n '_')
left_slant :: Int -> [String]
left_slant n = [replicate i '_' ++ ['1'] ++ replicate (n - i - 1) '_' | i <- [0..n - 1]]
right_slant :: Int -> [St... | EdisonAlgorithms/HackerRank | practice/fp/recursion/fractal-trees/fractal-trees.hs | mit | 1,344 | 0 | 14 | 448 | 710 | 373 | 337 | 32 | 1 |
-- (c) The University of Glasgow 2006
{-# LANGUAGE CPP #-}
-- | Highly random utility functions
--
module Util (
-- * Flags dependent on the compiler build
ghciSupported, debugIsOn, ncgDebugIsOn,
ghciTablesNextToCode,
isWindowsHost, isDarwinHost,
-- * General list processing
... | tjakway/ghcjvm | compiler/utils/Util.hs | bsd-3-clause | 42,098 | 0 | 19 | 12,604 | 10,937 | 5,986 | 4,951 | 614 | 7 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
module Stack.NixSpec where
import Test.Hspec
import Control.Monad.Logger
import Control.Exception
import Data.Monoid
import Network.HTTP.Conduit (Manager)
import System.Environment
import Path
impor... | harendra-kumar/stack | src/test/Stack/NixSpec.hs | bsd-3-clause | 2,067 | 0 | 20 | 403 | 521 | 266 | 255 | 55 | 1 |
module Main (main) where
import Ros.Service.ServiceTypes
import Ros.Service (callService)
import qualified Ros.Rospy_tutorials.AddTwoIntsRequest as Req
import Ros.Rospy_tutorials.AddTwoIntsResponse as Res
type Response a = IO (Either ServiceResponseExcept a)
main :: IO ()
main = do
response <- callService "/add_tw... | bitemyapp/roshask | Examples/AddTwoIntsClient/src/Main.hs | bsd-3-clause | 489 | 0 | 12 | 79 | 152 | 85 | 67 | 12 | 2 |
{-# OPTIONS -Wall -Werror #-}
module InferCombinators where
import Control.Arrow ((***))
import Control.Lens (Lens')
import Control.Lens.Operators
import Control.Monad (void)
import Data.Map ((!))
import Data.Maybe (fromMaybe)
import Data.Store.Guid (Guid)
import InferWrappers
import Lamdu.Data.Arbitrary () -- Arbitra... | schell/lamdu | test/InferCombinators.hs | gpl-3.0 | 7,581 | 0 | 15 | 1,432 | 2,481 | 1,278 | 1,203 | -1 | -1 |
module Main where
import Control.Concurrent
import Control.Exception
--import GlaExts
data Result = Died SomeException | Finished
-- Test stack overflow catching. Should print "Died: stack overflow".
stackoverflow :: Int -> Int
stackoverflow 0 = 1
stackoverflow n = n + stackoverflow n
main = do
let x = stackove... | ezyang/ghc | testsuite/tests/concurrent/should_run/conc012.hs | bsd-3-clause | 609 | 0 | 14 | 144 | 184 | 91 | 93 | 16 | 2 |
{-# LANGUAGE CPP #-}
-- | @unsafe@ variants of the "Language.C.Inline" quasi-quoters, to call the C code
-- unsafely in the sense of
-- <https://www.haskell.org/onlinereport/haskell2010/haskellch8.html#x15-1590008.4.3>.
-- In GHC, unsafe foreign calls are faster than safe foreign calls, but the user
-- must guarantee ... | fpco/inline-c | inline-c/src/Language/C/Inline/Unsafe.hs | mit | 1,952 | 0 | 7 | 333 | 168 | 113 | 55 | 16 | 1 |
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}
module JSONInstances where
import Types
import GHC.Generics (Generic)
import Data.Aeson
import Data.Text (Text)
import Control.Applicative
import Control.Monad (MonadPlus, mzero)
import qualified Data.HashMap.Strict as M
import Data.Vector (fromList)
instance FromJ... | danchoi/geochat | src/JSONInstances.hs | mit | 2,848 | 0 | 14 | 488 | 774 | 405 | 369 | 33 | 0 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.OESVertexArrayObject (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.OESVertexArrayObject
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.D... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/OESVertexArrayObject.hs | mit | 373 | 0 | 5 | 33 | 33 | 26 | 7 | 4 | 0 |
import Control.Monad
import Data.Char
-- sumDigits :: [Int] -> Int
sumDigits n = sum $ map digitToInt $ show n
primesSieve n = sieve [2..n]
where
sieve [] = []
sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p > 0]
-- round or ceiling?
intSqrt = floor . sqrt . fromIntegral
squeeze n p
| n `mo... | mgrebenets/hackerrank | alg/warmup/identify-smith-numbers.hs | mit | 1,200 | 0 | 17 | 354 | 475 | 244 | 231 | 25 | 2 |
module Map
( Map
, Room ( .. )
, numberRooms
, generateMap
, Wumpus ( .. )
) where
-- | Data types
data Room = Room { number :: Int, connections :: [Int] }
instance Show Room where
show r = "Room number: " ++ show (number r) ++ ", " ++ "Connected rooms: " ++ show (connections r) ++ "\n"
t... | garrettoreilly/Hunt-The-Wumpus | Map.hs | mit | 1,167 | 0 | 13 | 381 | 459 | 244 | 215 | 31 | 4 |
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# LANGUAGE TemplateHaskell #-}
import Prelude
import GLSL
import Test.DocTest
-- | >>> shaderName simpleVert
-- "test/res/simple.vert"
--
-- >>> shaderType simpleVert
-- VertexShader
simpleVert :: ShaderSource VertexShader
simpleVert = $("test/res/simple.vert" `shaderFi... | MaxDaten/vinyl-glsl | test/Example.hs | mit | 390 | 0 | 7 | 53 | 63 | 38 | 25 | 9 | 1 |
module Raytracer where
import GHC.Float
import Graphics.Gloss
import Math.Geom.Primitives hiding (Point)
import Math.Geom.Shapes
import Math.Geom.Intersections
import qualified Math.Vec as V
import Math.Vec (( *** ), ( /// ))
import Math.Matrix
import Scene
-- TODO: make accumulate readable
-- sort intersect results... | davidyu/Slowpoke | hs/src/raytracer.hs | mit | 1,999 | 0 | 20 | 653 | 762 | 417 | 345 | -1 | -1 |
module Y2016.M07.D05.Exercise where
{--
So, let's say, for example, hypothetically speaking, that we have a set of
jUnit test cases as XML, or some other sensitive data that you wish to obscure
before you share with a larger public audience?
How do you translates "sensitive data" to 'coded data'?
--}
import Control.... | geophf/1HaskellADay | exercises/HAD/Y2016/M07/D05/Exercise.hs | mit | 1,356 | 0 | 7 | 224 | 78 | 49 | 29 | 8 | 1 |
isSingleElement index = index == 0
middle list = quot (length list) 2
handleSingle a = case a of
EQ -> Just 0
_ -> Nothing
binarySearch element sortedList =
let middleIndex = middle sortedList
middleElement = sortedList !! middleIndex
comparison = compare element middleElement
in if isSingleEleme... | diminishedprime/.org | programmey_stuff/algorithms/binary_search.hs | mit | 684 | 0 | 16 | 197 | 194 | 93 | 101 | 17 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Network.Anonymous.TorSpec where
import Control.Concurrent (threadDelay)
import Control.Concurrent.MVar
import qualified Network.Anonymous.Tor as Tor
import qualified Network.Socks5.Types as SocksT
import q... | solatis/haskell-network-anonymous-tor | test/Network/Anonymous/TorSpec.hs | mit | 2,002 | 0 | 15 | 569 | 466 | 236 | 230 | 42 | 1 |
{-
Euler discovered the remarkable quadratic formula:
n² + n + 41
It turns out that the formula will produce 40 primes for the consecutive values
n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible
by 41, and certainly when n = 41, 41² + 41 + 41 is clearly divisible by 41.
The incre... | dpieroux/euler | 0/0027.hs | mit | 3,004 | 0 | 19 | 629 | 388 | 223 | 165 | 15 | 2 |
import System.Environment (getArgs)
import System.Exit
import System.IO
import Control.Exception
import Network
import Control.Concurrent (forkIO)
import Data.IORef
import Control.Monad
errorMessage = "Unknown command: "
exitMessage = "Client killed service. Byeeeee......"
maxConnections = 2000 -- some arbritrary cons... | IanConnolly/CS4032 | lab2/server.hs | mit | 3,547 | 0 | 17 | 1,114 | 857 | 426 | 431 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
module Web.Mackerel.Types.Role where
import Data.Aeson.TH (deriveJSON)
import Web.Mackerel.Internal.TH
data Role
= Role {
roleName :: String,
roleMemo :: String
} deriving (Eq, Show)
$(deriveJSON options ''Role)
| itchyny/mackerel-client-hs | src/Web/Mackerel/Types/Role.hs | mit | 261 | 0 | 8 | 46 | 73 | 44 | 29 | 10 | 0 |
{-# LANGUAGE ExistentialQuantification, Rank2Types, ImpredicativeTypes #-}
module Database.Siege.DoStore where
import Control.Monad
import Control.Monad.Trans
import Data.Word
import Data.Char
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import qualified Control.Monad.Trans.Store a... | DanielWaterworth/siege | src/Database/Siege/DoStore.hs | mit | 1,915 | 7 | 24 | 445 | 787 | 397 | 390 | 56 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import LispVal ( LispVal )
import Eval
( basicEnv,
getFileContents,
runASTinEnv,
safeExec,
textToEvalForm )
import qualified Data.Text as T
import Test.Tasty ( defaultMain, testGroup, TestName, TestTree )
import Test.Tasty.Golden... | write-you-a-scheme-v2/scheme | test-hs/Golden/Main.hs | mit | 3,075 | 0 | 10 | 649 | 545 | 286 | 259 | -1 | -1 |
{-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Protolude.Bifunctor
( Bifunctor,
bimap,
first,
second,
)
where
import Control.Applicative (Const (Const))
import Data.Either (Either (Left, Right))
import Data.Function ((.), id)
class Bifunctor p where
{-# MINIMAL bimap | first, secon... | sdiehl/protolude | src/Protolude/Bifunctor.hs | mit | 1,271 | 0 | 10 | 329 | 724 | 400 | 324 | 35 | 0 |
{-# LANGUAGE TemplateHaskell #-}
module Ocram.Analysis.CallGraph
-- exports {{{1
(
BlockingFunctions, StartFunctions, CriticalFunctions, Footprint
, call_graph, from_test_graph, to_test_graph
, blocking_functions, start_functions, critical_functions
, is_blocking, is_start, is_critical
, call_chain, call_or... | copton/ocram | ocram/src/Ocram/Analysis/CallGraph.hs | gpl-2.0 | 7,971 | 0 | 21 | 1,547 | 2,774 | 1,478 | 1,296 | 171 | 3 |
---------------------------------------------------------
--
-- Module : Sample
-- Copyright : Bartosz Wójcik (2011)
-- License : Private
--
-- Maintainer : bartek@sudety.it
-- Stability : Unstable
-- Portability : portable
--
-- Part of ELCA. Quick Check sample test cases.
--------... | bartoszw/elca | Sample.hs | gpl-2.0 | 912 | 14 | 7 | 349 | 128 | 81 | 47 | 11 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Telegram
import qualified Data.ByteString.Lazy.Char8 as L
import Control.Monad (mapM_)
import Data.List (isInfixOf)
import Data.Char (toLower)
--[ ("who.*fat", "I'm fat!")
--, ("harrison.*fat", "No you")
--, ("harrison is", "No you")
--, ("rock", "RRROOCCKK... | ayron/telegram-haskell-bot | Main.hs | gpl-2.0 | 373 | 0 | 7 | 71 | 70 | 43 | 27 | 9 | 1 |
---------------
-- xmonad.hs --
--- by DaeS ---
---------------
-- Import -------------------------------------------------
import XMonad -- XMonad
import XMonad.Hooks.DynamicLog -- Xmobar
import qualified XMonad.StackSet as W -- Keys
import qualified Data.Map as M -- Keys
import... | procrastonos/dotfiles | xmonad/xmonad.hs | gpl-2.0 | 14,873 | 53 | 15 | 3,699 | 2,808 | 1,673 | 1,135 | 159 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- Copyright (c) 2012, Diego Souza
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copy... | dgvncsz0f/sssfs | src/SSSFS/Filesystem/Types.hs | gpl-3.0 | 11,257 | 0 | 15 | 4,162 | 2,774 | 1,518 | 1,256 | 247 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Freenet.Chk (
-- * Working with CHKs
ChkRequest(..), ChkBlock(..), mkChkBlock, decompressChk,
encryptChk, chkBlockUri, chkDataSize,
decryptChk,
-- * CHK Headers
ChkHeader, mkChkHeader, unChkHeader, chkHeaderHashId,
chkHeaderHash, chkHeaderCipherLen
) where
i... | waldheinz/ads | src/lib/Freenet/Chk.hs | gpl-3.0 | 9,519 | 12 | 16 | 2,244 | 2,468 | 1,296 | 1,172 | 171 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Tracks/List.hs | mpl-2.0 | 3,365 | 0 | 15 | 794 | 387 | 233 | 154 | 65 | 1 |
{-# LANGUAGE PatternSynonyms #-}
pattern x :> y = [x, y]
| lspitzner/brittany | data/Test243.hs | agpl-3.0 | 57 | 0 | 6 | 11 | 20 | 11 | 9 | 2 | 0 |
-- Copyright (C) 2016 Red Hat, Inc.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- This library i... | dashea/bdcs | importer/BDCS/KeyValue.hs | lgpl-2.1 | 1,414 | 0 | 17 | 317 | 271 | 144 | 127 | 17 | 1 |
module LSystem (
LSystem(..),
interpretLSystem,
parseLSystem,
parseAndEvalSymbols
) where
import Data.List
import Data.Maybe
import LSystem.Utils
import LSystem.DataTypes
import LSystem.Expressions
import LSystem.ShowReadUtils
-------------------------------------------------------------------------... | NightElfik/L-systems-in-Haskell | src/LSystem.hs | unlicense | 3,183 | 0 | 13 | 685 | 787 | 408 | 379 | 61 | 3 |
module ProjectM36.TransactionDiffs where
import ProjectM36.Base
import Data.List.NonEmpty
import Data.UUID as U
{-
root :: TransactionDiffs
root = single U.nil NoOperation
single :: TransactionId -> TransactionDiffExpr -> TransactionDiffs
single tid expr = (tid, expr) :| []
-}
| agentm/project-m36 | src/lib/ProjectM36/TransactionDiffs.hs | unlicense | 280 | 0 | 4 | 38 | 25 | 17 | 8 | 4 | 0 |
import Data.List
tr _ [] = []
tr tab (x:xs) = (tab!!x):(tr tab xs)
ans' x =
let u = sort $ nub x
r = case u of
[1,2,3] -> replicate 5 3
[1] -> replicate 5 3
[2] -> replicate 5 3
[3] -> replicate 5 3
[1,2] -> tr [0,1,2,0] x
... | a143753/AOJ | 0205.hs | apache-2.0 | 637 | 0 | 13 | 293 | 363 | 188 | 175 | 25 | 8 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports -fcontext-stack=590 #-}
module Openshift.OapivApi (
connectP... | minhdoboi/deprecated-openshift-haskell-api | openshift/lib/Openshift/OapivApi.hs | apache-2.0 | 180,190 | 0 | 2,822 | 24,318 | 47,202 | 22,875 | 24,327 | 1,228 | 1 |
-- Copyright 2017 Ondrej Sykora
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in ... | ondrasej/heavenly-bodies | src/HBodies/Player/State.hs | apache-2.0 | 1,996 | 0 | 10 | 410 | 224 | 141 | 83 | 32 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Codec.Sarsi.Scala where
import Codec.Sarsi (Level (..), Location (..), Message (..))
import Data.Attoparsec.Combinator (lookAhead)
import Data.Attoparsec.Text
import Data.Text (Text)
import qualified Data.Text as Text
import System.FilePath (makeRelative)
messageParser :: Fi... | aloiscochard/sarsi | src/Codec/Sarsi/Scala.hs | apache-2.0 | 1,416 | 0 | 16 | 278 | 526 | 276 | 250 | 33 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,FlexibleInstances, UndecidableInstances #-}
module Lib.Distance where
import Data.Map as M
import Data.List
------------------------------------------------ Distances --------------------------------
class Num b => Distance a b | a -> b where
dist :: a -> a... | paolino/hgen | Lib/Distance.hs | bsd-2-clause | 854 | 0 | 16 | 148 | 286 | 149 | 137 | 16 | 3 |
module HEP.Util.QQ.Verbatim where
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Lib
verbatim :: QuasiQuoter
verbatim = QuasiQuoter {
quoteExp = litE . stringL
-- , quotePat = litP . stringP
}
| wavewave/HEPUtil | src/HEP/Util/QQ/Verbatim.hs | bsd-2-clause | 279 | 0 | 7 | 68 | 52 | 35 | 17 | 7 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
-- |
-- Module : Criterion.Monad.Internal
-- Copyright : (c) 2009 Neil Brown
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- The... | bos/criterion | Criterion/Monad/Internal.hs | bsd-2-clause | 1,377 | 0 | 13 | 269 | 315 | 192 | 123 | 31 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Exception (Exception, SomeException,
toException)
import Control.Monad (unless)
import Control.Monad.Catch (Handler (..), MonadThrow, catches,
... | LightAndLight/psbt | app/Main.hs | bsd-3-clause | 7,699 | 11 | 19 | 2,229 | 2,039 | 1,027 | 1,012 | 176 | 6 |
import Test.QuickCheck
(
quickCheck
,verboseCheck
,shrink
,forAll
,listOf
)
import Test.QuickCheck.Gen
(
choose
,Gen (..)
)
import Test.QuickCheck.Property
(
Property (..)
)
import System.Random
(
Random (..)
)
import Data.List (sort)
sum' :: Num a => [a] -> a
sum' [] = 0
sum' ... | simone-trubian/blog-posts | QuickCheck/Quick.hs | bsd-3-clause | 800 | 0 | 8 | 179 | 336 | 183 | 153 | 33 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wall #-}
{-| This module contains the core machinery for the Annah language, which is a
medium-level language that desugars to Morte.
The main high-level features that Annah does not provide compared to Haskell
are:
* type classes
* type infer... | Gabriel439/Haskell-Annah-Library | src/Annah/Core.hs | bsd-3-clause | 17,887 | 32 | 22 | 6,380 | 4,593 | 2,395 | 2,198 | 289 | 9 |
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
import System.Environment
import qualified Data.Text as T
import Data.Enumerator (joinI, ($$), run_)
import Text.XML.Enumerator.Parse (parseBytes)
import Data.Enumerator.Binary (enumFile)
import Text.Roundtrip
import Text.Roundtrip.Xml
import Text.Roundtrip.Xml.Enu... | skogsbaer/roundtrip | test/Test.hs | bsd-3-clause | 1,146 | 0 | 10 | 268 | 322 | 170 | 152 | 33 | 1 |
module Config.File (T(..), load) where
import Control.Monad
import Data.Text
import Data.Yaml
data T = ConfigFile
{ serverUrl :: Text
, serverPort :: Int
, serverAllowOrigins :: [Text]
, proxyHost :: Text
, proxyPort :: Int
, proxyKeyFile :: FilePath
, postmarkK... | ktvoelker/auth-proxy | src/Config/File.hs | bsd-3-clause | 1,339 | 1 | 32 | 401 | 441 | 257 | 184 | 40 | 1 |
{-# LANGUAGE NoImplicitPrelude
, CPP
, GeneralizedNewtypeDeriving
, PatternGuards
#-}
-----------------------------------------------------------------------------
-- |
-- Module : Math.Combinatorics.Species.Labeled
-- Copyright : (c) Brent Yorgey 2010
-- License : BSD-... | timsears/species | Math/Combinatorics/Species/Labeled.hs | bsd-3-clause | 3,604 | 2 | 21 | 905 | 621 | 360 | 261 | 46 | 1 |
module Main(main) where
import qualified Detrospector.Main as D
main :: IO ()
main = D.main
| kmcallister/detrospector | detrospector.hs | bsd-3-clause | 94 | 0 | 6 | 17 | 34 | 21 | 13 | 4 | 1 |
{-# LANGUAGE
OverloadedStrings
, ConstraintKinds
, FlexibleContexts
, MultiParamTypeClasses
#-}
module Application.Session where
import Application.Types
import qualified Data.TimeMap as TM
import Data.UUID (UUID)
import Data.UUID.V4 (nextRandom)
import qualified Data.ByteString.UTF8 as BS
import quali... | athanclark/nested-routes-website | src/Application/Session.hs | bsd-3-clause | 1,657 | 0 | 15 | 363 | 441 | 234 | 207 | 48 | 1 |
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.Haskell.TH.OverloadApp
-- Copyright : (c) 2012 Michael Sloan
-- License : BSD-style (see the LICENSE file)
-- Maintainer : Michael Sloan <mgsloan@gmail.com>
-- Stability ... | mgsloan/quasi-extras | src/Language/Quasi/OverloadApp.hs | bsd-3-clause | 2,752 | 0 | 6 | 621 | 98 | 71 | 27 | 9 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Network.DomainAuth.DKIM.Types where
import Data.ByteString (ByteString)
import Network.DNS
import Network.DomainAuth.Mail
----------------------------------------------------------------
-- | Canonicalized key for DKIM-Signature:.
dkimFieldKey :: CanonFieldKey
dkimFieldKey ... | kazu-yamamoto/domain-auth | Network/DomainAuth/DKIM/Types.hs | bsd-3-clause | 1,173 | 0 | 9 | 196 | 201 | 125 | 76 | 25 | 1 |
module MC.Protocol
( ClientPacket
, ServerPacket
, module MC.Protocol.Types
) where
import MC.Protocol.Types
import MC.Protocol.Client (ClientPacket)
import MC.Protocol.Server (ServerPacket)
| ehird/mchost | MC/Protocol.hs | bsd-3-clause | 200 | 0 | 5 | 28 | 49 | 32 | 17 | 7 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Filter where
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.Text as T
import Data.Maybe (fromJust, isJust)
import Control.Lens
import Data.List
import qualified Data.Set as S
import Card
getAllCardData :: IO [Card]
getAllCardData =... | Frefreak/hearthstone-cardsearch | client/src/Filter.hs | bsd-3-clause | 2,688 | 0 | 15 | 722 | 1,078 | 585 | 493 | 78 | 2 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
-}
{-# LANGUAGE CPP #-}
module IfaceSyn (
module IfaceType,
IfaceDecl(..), IfaceFamTyConFlav(..), IfaceClassOp(..), IfaceAT(..),
IfaceConDecl(..), IfaceConDecls(..), IfaceEqSpec,
IfaceExpr(... | oldmanmike/ghc | compiler/iface/IfaceSyn.hs | bsd-3-clause | 76,590 | 77 | 29 | 25,263 | 18,716 | 9,314 | 9,402 | 1,467 | 12 |
module Numerical.HBLAS.Lapack.FFI where
import Foreign.Ptr
import Foreign()
import Foreign.C.Types
import Data.Complex
import Data.Int
{-?ges
-}
{-
stylenote: we will not use the LAPACKE_* operations, only the
LAPACKE_*_work variants that require an explicitly provided work buffer.
This is to ensure that solver ... | wellposed/hblas | src/Numerical/HBLAS/Lapack/FFI.hs | bsd-3-clause | 4,460 | 0 | 28 | 942 | 718 | 386 | 332 | 40 | 0 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
--
-- Module : Venue
-- Copyright : Copyright © 2014, Quixoftic, LLC <src@quixoftic.com>
-- License : BSD3 (see LICENSE file)
-- Maintainer : dhess-src@quixoftic.com
-- Stability : experimental
-- Portability : GHC
--
-- SXSW music venue representation.
-... | quixoftic/Sxcrape | src/Venue.hs | bsd-3-clause | 675 | 0 | 10 | 146 | 122 | 76 | 46 | 12 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DuplicateRecordFields #-}
module GameState where
import GHC.Generics
import Data.Aeson
import Data.Aeson.Types
import Data.Graph.Inductive.Graph as G
import Data.Graph.Inductive.PatriciaTree
import Pr... | nobsun/icfpc2017 | hs/src/GameState.hs | bsd-3-clause | 1,778 | 0 | 12 | 326 | 611 | 337 | 274 | 47 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Hint.Compat
where
#if __GLASGOW_HASKELL__ < 702
import Control.Monad.Trans (liftIO)
#endif
#if __GLASGOW_HASKELL__ >= 704
import Control.Monad (foldM, liftM)
#endif
import qualified Hint.GHC as GHC
-- Kinds became a ... | hakaru-dev/hint-exts | src/Hint/Compat.hs | bsd-3-clause | 8,226 | 0 | 12 | 1,531 | 995 | 556 | 439 | 38 | 1 |
{-# LANGUAGE CPP, TypeFamilies, ViewPatterns, OverloadedStrings #-}
-- -----------------------------------------------------------------------------
-- | This is the top-level module in the LLVM code generator.
--
module LlvmCodeGen ( LlvmVersion, llvmVersionList, llvmCodeGen, llvmFixupAsm ) where
#include "HsVersion... | sdiehl/ghc | compiler/llvmGen/LlvmCodeGen.hs | bsd-3-clause | 7,484 | 0 | 25 | 1,956 | 1,668 | 832 | 836 | 133 | 3 |
--------------------------------------------------------------------------------
-- | This module provides a Heist frontend for the digestive-functors library.
--
-- Disclaimer: this documentation requires very basic familiarity with
-- digestive-functors. You might want to take a quick look at this tutorial
-- first:
... | f-me/digestive-functors-heist | src/Text/Digestive/Heist.hs | bsd-3-clause | 19,350 | 0 | 21 | 4,490 | 4,052 | 2,173 | 1,879 | 259 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
... | bjornbm/astro | test/TestInstances.hs | bsd-3-clause | 8,581 | 0 | 20 | 1,680 | 2,860 | 1,506 | 1,354 | 150 | 1 |
import qualified System.Exit
import System.IO
main = do
-- don't buffer input and output
System.IO.hSetBuffering stdin NoBuffering
System.IO.hSetBuffering stdout NoBuffering
putStr "Are you sure? [Y/n] "
answer <- getChar
if positive answer
then System.Exit.exitSuccess
else Syst... | shiroyasha/ask | ask.hs | bsd-3-clause | 402 | 0 | 9 | 95 | 95 | 48 | 47 | 11 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Data.TileMap where
import Data.Grid
import Data.Points
import Data.Surrounding
import Data.TileSet
import Error
import Util
import Control.Applicative
import qualified Data.Traversable as T
newtype TileMap c = TileMap
{ tileMap :: Grid c TileIndex
} deriving (Eq,Show)
... | kylcarte/wangtiles | src/Data/TileMap.hs | bsd-3-clause | 5,881 | 0 | 11 | 1,106 | 2,305 | 1,168 | 1,137 | 119 | 1 |
import Graphics.UI.GLUT.Turtle
import Graphics.UI.GLUT hiding (position, initialize, clear)
main :: IO ()
main = do
_args <- initialize
f <- openField "test" 640 480
c <- openConsole "console" 640 480
consolePrompt c "> "
setConsole f c
t <- newTurtle f
onclick f $ \_bn x y -> goto t x y >> return True
oncomma... | YoshikuniJujo/gluturtle | tests/testGLUT.hs | bsd-3-clause | 2,710 | 2 | 10 | 542 | 1,120 | 548 | 572 | 47 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TupleSections #-}
module Generalization where
import Control.Exception.Base
import Data.List hiding (group, groupBy)
import qualified Data.Map ... | kajigor/uKanren_transformations | src/Generalization.hs | bsd-3-clause | 4,323 | 0 | 27 | 1,109 | 1,983 | 1,028 | 955 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ExistentialQuantification #-}
module Graphics.Rendering.Ipe.Attributes where
import Data.Char(toLower)
import Data.Maybe
import Data.Semigroup
import Data.Text(Text)
import Data.Text.Format
import Text.XML(Name)
import Diagrams.Attribut... | noinia/diagrams-ipe | src/Graphics/Rendering/Ipe/Attributes.hs | bsd-3-clause | 8,900 | 0 | 12 | 1,959 | 1,308 | 727 | 581 | 110 | 1 |
{-# LANGUAGE RankNTypes, MultiParamTypeClasses,FlexibleInstances, FlexibleContexts #-}
import Criterion.Types
import qualified Data.Discrimination as D
import Data.Ix
import Data.List
import Test.BigOh
import qualified Test.BigOh.Fit.R as R
import Control.Monad
import Prelude... | tranma/big-oh | example/codensity.hs | bsd-3-clause | 3,195 | 0 | 15 | 977 | 1,436 | 730 | 706 | 88 | 1 |
-- | Extended utilities for 'Bool' type.
module Extended.Data.Bool
( (==>)
) where
import Universum
-- | Logical implication.
(==>) :: Bool -> Bool -> Bool
False ==> _ = True
True ==> x = x
infixr 4 ==>
| serokell/importify | src/Extended/Data/Bool.hs | mit | 231 | 0 | 6 | 67 | 61 | 36 | 25 | 7 | 1 |
-- https://www.codewars.com/kata/fruit-machine
module Haskell.SylarDoom.FruitMachine where
import Data.List (group, sort, sortOn)
fruit :: [[String]] -> [Int] -> Int
fruit = (score .) . extract
extract :: [[String]] -> [Int] -> [String]
extract = zipWith (!!) . map cycle
score :: [String] -> Int
score items =
ca... | airtial/Codegames | codewars/fruit-machine.hs | gpl-2.0 | 977 | 0 | 11 | 182 | 343 | 188 | 155 | 30 | 4 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/CancelJob.hs | mpl-2.0 | 3,133 | 0 | 9 | 708 | 367 | 226 | 141 | 49 | 1 |
{-# OPTIONS_GHC -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Comonad.Stream
-- Copyright : (C) 2008 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : ... | urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav | Control/Comonad/Stream.hs | apache-2.0 | 739 | 4 | 5 | 125 | 52 | 38 | 14 | 6 | 0 |
import Paraiso
import Integrator
import System.Environment
import Debug.Trace
main = do
args <- getArgs
let arch = if "--cuda" `elem` args then
CUDA 128 128
else
X86
putStrLn $ compile arch code
where
code = do
parallel 16384 $ do
x <- alloca... | nushio3/Paraiso | attic/paraiso-2008-ODEsolver/MainLorenz.hs | bsd-3-clause | 842 | 0 | 22 | 431 | 310 | 149 | 161 | 30 | 2 |
{- |
Module : $Header$
Copyright : (c) Christian Maeder, Uni Bremen 2004-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : provisional
Portability : portable
static analysis of modal logic parts
-}
module Modal.StatAna (basicModalAnalysis, mi... | mariefarrell/Hets | Modal/StatAna.hs | gpl-2.0 | 9,719 | 1 | 28 | 3,215 | 3,002 | 1,450 | 1,552 | 213 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.