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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-
- ``Data/PriorityQueue''
- (c) 2008 Cook, J. MR SSD, Inc.
-
- the PriorityQueue kicks ass, if I do say so myself ;-)
- the |DefaultStateRef| class makes the choice of StateRef
- decidable, and the laxity of the StateRef classes' fundeps makes
- queues constructible in mona... | zuoqin/hackerrank | src/Data/PriorityQueue.hs | bsd-3-clause | 7,452 | 0 | 22 | 2,184 | 1,948 | 1,035 | 913 | 107 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
-- | FromJSON instances for Hangouts data.
module Data.Hangouts.JSON () where
import Control.Applicative
import Control.Monad
import Data.Aeson
import Data.Aeson.Types
import Data.List (foldl')
import Data.Maybe
import qualified Data.Map.Strict as... | valderman/hangouts-logbaker | Data/Hangouts/JSON.hs | bsd-3-clause | 3,547 | 0 | 23 | 943 | 1,114 | 546 | 568 | 86 | 3 |
module MatchUtil where
import Control.Applicative
import Control.Monad
import Control.Monad.Error
import Match
strict :: ([a] -> Matcher b) -> [Matcher a] -> Matcher b
strict f a = sequence a >>= f
args1 :: (Value -> Matcher Value) -> [Value] -> Matcher Value
args1 f [a] = f a
args1 f _ = throwError "1 argument... | ratatosk/traceblade | MatchUtil.hs | bsd-3-clause | 1,027 | 0 | 10 | 255 | 530 | 269 | 261 | 26 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
module CO4.Algorithms.HindleyMilner.W
( HMConfig (..), IntroduceTLamTApp (..)
, initialContext, schemeOfExp, schemesConfig, schemes, withSchemes)
where
import Prelude hiding (lookup)
import Control.Monad.Identity
import ... | apunktbau/co4 | src/CO4/Algorithms/HindleyMilner/W.hs | gpl-3.0 | 13,110 | 0 | 21 | 4,103 | 3,688 | 1,899 | 1,789 | 232 | 12 |
x = .2
| roberth/uu-helium | test/parser/ConfusingFloat2.hs | gpl-3.0 | 8 | 1 | 4 | 4 | 8 | 4 | 4 | -1 | -1 |
module Playground where
import Data.HashPSQ as PSQ
import Driver
import Scheduling.Algorithm.RoundRobin as RR
import Scheduling.Algorithm.ShortestJobFirst as SJF
import Scheduling.Driver.CustomDrivers
import Scheduling.Types
-- | Sample list of jobs to schedule.
jobList :: [Job]
jobList = [mkJob "A" 4 (Priority 3),
... | mrenaud92/Scheduling | src/Playground.hs | bsd-3-clause | 832 | 0 | 8 | 146 | 182 | 106 | 76 | 15 | 1 |
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "Data/Attoparsec.hs" #-}
-- |
-- Module : Data.Attoparsec
-- Copyright : Bryan O'Sullivan 2007-2015
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : unknown
--
-- Simple, efficient combinator parsing for
-- 'Da... | phischu/fragnix | tests/packages/scotty/Data.Attoparsec.hs | bsd-3-clause | 670 | 0 | 5 | 127 | 39 | 32 | 7 | 7 | 0 |
-- This module based upon code described in
-- "Structuring Depth First Search Algorithms in Haskell"
-- by David King and John Launchbury
-- Proc. ACM Principles of Programming Languages, San Francisco, 1995.
module DepthFirstSearch where
import Control.Monad.ST
import Data.Array.ST
import qualified Data.Array as A... | cartazio/omega | src/DepthFirstSearch.hs | bsd-3-clause | 3,643 | 0 | 17 | 1,089 | 1,443 | 771 | 672 | 76 | 2 |
module Graphics.QML.Internal.MetaObj where
import Graphics.QML.Internal.Types
import Control.Monad
import Control.Monad.Trans.State (State, execState, get, put)
import Data.Bits
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe
import Foreign.C.Types
import Foreign.C.String
import Foreign.Ptr
i... | johntyree/HsQML | src/Graphics/QML/Internal/MetaObj.hs | bsd-3-clause | 8,697 | 0 | 18 | 2,307 | 2,654 | 1,384 | 1,270 | 234 | 4 |
-- (c) 2000 - 2002 by Martin Erwig [see file COPYRIGHT]
-- | Maximum Independent Node Sets
module Data.Graph.Inductive.Query.Indep (
indep
) where
import Data.Graph.Inductive.Graph
first :: (a -> Bool) -> [a] -> a
first p = head . filter p
indep :: DynGraph gr => gr a b -> [Node]
indep g | isEmpty g = []
inde... | FranklinChen/hugs98-plus-Sep2006 | packages/fgl/Data/Graph/Inductive/Query/Indep.hs | bsd-3-clause | 667 | 0 | 12 | 257 | 243 | 127 | 116 | 14 | 2 |
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE helpset
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
"http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="en-GB">
<title>Groovy Support</title>
<maps>
<homeID>top</homeID>
<mapref l... | veggiespam/zap-extensions | addOns/groovy/src/main/javahelp/org/zaproxy/zap/extension/groovy/resources/help/helpset.hs | apache-2.0 | 972 | 81 | 67 | 169 | 417 | 213 | 204 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Proxy
import Data.Type.Equality
type family F (x :: f (a :: k)) :: f a
f :: forall k (f :: k -> Type) (a :: k) ... | sdiehl/ghc | testsuite/tests/polykinds/T15577.hs | bsd-3-clause | 575 | 0 | 10 | 152 | 195 | 113 | 82 | -1 | -1 |
-- Manually write instances.
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Twitter.Manual
(
Metadata(..)
, Geo(..)
, Story(..)
, Result(..)
) where
import Control.Applicative
import Data.Aeson hiding (Result)
import Data.Monoid ((<>))
impor... | 23Skidoo/aeson | examples/Twitter/Manual.hs | bsd-3-clause | 4,003 | 0 | 33 | 1,320 | 999 | 526 | 473 | 120 | 0 |
module D5 where
data BTree a
= Empty | T a (BTree a) (BTree a) deriving Show
buildtree :: Ord a => [a] -> BTree a
buildtree [] = Empty
buildtree ((x : xs)) = insert x (buildtree xs)
insert :: Ord a => a -> (BTree a) -> BTree a
insert val v2
= case v2 of
new@(T val Empty Empty)
... | kmate/HaRe | old/testing/unfoldAsPatterns/D5AST.hs | bsd-3-clause | 597 | 0 | 11 | 208 | 277 | 144 | 133 | 19 | 3 |
module Distribution.Solver.Types.DependencyResolver
( DependencyResolver
) where
import Data.Set (Set)
import Distribution.Solver.Types.LabeledPackageConstraint
import Distribution.Solver.Types.PkgConfigDb ( PkgConfigDb )
import Distribution.Solver.Types.PackagePreferences
import Distribution.Solver.Types.Pac... | sopvop/cabal | cabal-install/Distribution/Solver/Types/DependencyResolver.hs | bsd-3-clause | 1,513 | 0 | 15 | 373 | 205 | 127 | 78 | 23 | 0 |
module ShouldFail where
-- !!! newlines in strings aren't allowed
f = "
"
| urbanslug/ghc | testsuite/tests/parser/should_fail/readFail002.hs | bsd-3-clause | 76 | 3 | 3 | 16 | 10 | 8 | 2 | -1 | -1 |
module FP15.Compiler.Syntax.SmartSplit (smartSplit) where
import Data.Maybe
import FP15.Types()
-- | The 'smartSplit' function splits a list so that each part satisfy the
-- predicate and the lengths of the left parts are greedily maximized. If there
-- is no solution, or the input list is empty, the result is 'Nothin... | Ming-Tang/FP15 | src/FP15/Compiler/Syntax/SmartSplit.hs | mit | 1,253 | 0 | 11 | 262 | 242 | 138 | 104 | 11 | 1 |
module Rebase.Data.ByteString.Builder.Internal
(
module Data.ByteString.Builder.Internal
)
where
import Data.ByteString.Builder.Internal
| nikita-volkov/rebase | library/Rebase/Data/ByteString/Builder/Internal.hs | mit | 140 | 0 | 5 | 12 | 26 | 19 | 7 | 4 | 0 |
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, DataKinds, KindSignatures,
PolyKinds, UnboxedTuples, GHCForeignImportPrim, DeriveDataTypeable,
UnliftedFFITypes, MagicHash
#-}
module JavaScript.Array.Internal where
import Prelude hiding (length, reverse, drop, take)
import ... | tavisrudd/ghcjs-base | JavaScript/Array/Internal.hs | mit | 6,011 | 68 | 12 | 1,230 | 1,877 | 962 | 915 | 143 | 1 |
module Args (helpmsg,
compilerOpts,
Flag (..)) where
import System.Console.GetOpt
data Flag = Help | Server | Client String
deriving(Ord, Show, Eq)
options :: [OptDescr Flag]
options =
[ Option ['h'] ["help"] (NoArg Help) "print Help"
, Option ['s'] ["server"] (NoArg Server) "... | agomezl/TicTacToe | src/Args.hs | mit | 832 | 0 | 13 | 196 | 294 | 163 | 131 | 20 | 2 |
module Main where
add :: Int -> Int -> Int
add x y = x + y
-- With Currying, you can 'partially' apply
-- some function with fewer parameters.
-- Doing so will give you a function as result.
-- This resulting function would accept the remaining parameters
-- that were not applyed and return the same result as the
-- ... | hbobenicio/haskell-examples | currying/Main.hs | mit | 468 | 0 | 10 | 106 | 105 | 54 | 51 | 10 | 1 |
module Spear.Math.Plane
(
Plane
, plane
, classify
)
where
import Spear.Math.Vector
data PointPlanePos = Front | Back | Contained deriving (Eq, Show)
data Plane = Plane
{ n :: {-# UNPACK #-} !Vector3,
d :: {-# UNPACK #-} !Float
}
deriving(Eq, Show)
-- | Construct a plane ... | jeannekamikaze/Spear | Spear/Math/Plane.hs | mit | 1,042 | 0 | 9 | 338 | 275 | 156 | 119 | 25 | 3 |
module Main where
import Language.Egison.Core
import Language.Egison.Types
import Language.Egison.Parser
import Control.Monad.Error
import System.Cmd (system)
import System.Console.GetOpt
import System.FilePath (dropExtension)
import System.Environment
import System.Directory (doesFileExist, copyFile, removeFile)
impor... | aretoky/egison2 | hs-src/Compiler/egisonc.hs | mit | 6,134 | 0 | 19 | 1,507 | 1,714 | 856 | 858 | 161 | 5 |
{-
- Parse TCP header conforming to http://tools.ietf.org/html/rfc793
-}
module TCP (TCP(..), parseTCP, TCPFlags(..), Port) where
import Control.Monad
import Data.Bits
import Data.Serialize
import Data.Word
type Port = Word16
type SeqNo = Word32
data TCP = TCP
{ tcpSPort :: Port
, tcpDPort :: Port
, tcpSeqNr... | mihaimaruseac/petulant-octo-avenger | src/TCP.hs | mit | 1,820 | 0 | 14 | 469 | 715 | 393 | 322 | 58 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- Copyright (c) 2013, 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 copyright ... | dgvncsz0f/nettty | src/Nettty/Protocol.hs | gpl-3.0 | 5,833 | 0 | 17 | 1,459 | 1,480 | 756 | 724 | 151 | 2 |
module Merge where
import Prelude hiding ((.))
-- Apparently this gives rise to lets which bind the same name
-- That's really ugly.
f . g = \x -> f (g x)
isGT GT = True
isGT _ = False
isn'tGT GT = False
isn'tGT _ = True
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
sortBy cmp = mergeAll . sequences
where
... | danr/hipspec | tfp1/tests/Merge.hs | gpl-3.0 | 1,099 | 0 | 12 | 370 | 307 | 161 | 146 | 19 | 5 |
data User = Chair | Alice | Bob | Default
-- | Value tagged with a policy
{-@ data Tagged a <p :: User->Prop> = Tagged (content :: a) @-}
data Tagged a = Tagged a
{-@ ret :: forall a <p :: User -> Prop>.
a -> Tagged <p> a @-}
ret :: a -> Tagged a
ret x = Tagged x
{-@ bind :: forall a b <p :: User ... | ackao/APRICoT | basic_lhs_tests/Security.hs | gpl-3.0 | 2,452 | 0 | 10 | 684 | 300 | 172 | 128 | -1 | -1 |
module MinFree where
import Test.QuickCheck
import qualified Data.Array as DA
import Data.List (partition,nub)
(\\) :: Eq a => [a] -> [a] -> [a]
xs \\ ys = filter (`notElem` ys) xs
minFreeSimple :: [Int] -> Int
minFreeSimple xs = head $ [0..] \\ xs
search :: DA.Array Int Bool -> Int
search = length . takeWhile id .... | markus1189/PearlsFAD | src/MinFree.hs | gpl-3.0 | 2,010 | 0 | 10 | 450 | 911 | 487 | 424 | 45 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Numerical.PETSc.Test
-- Copyright : (c) Marco Zocca 2015
-- License : LGPL3
-- Maintainer : zocca . marco . gmail . com
-- Stability : experimental
--
-- | misc. tests
--
-----------------------------------... | ocramz/petsc-hs | src/Numerical/PETSc/Test.hs | gpl-3.0 | 16,408 | 0 | 19 | 4,557 | 2,450 | 1,432 | 1,018 | 159 | 1 |
{-# OPTIONS_GHC -Wno-orphans #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Nirum... | spoqa/nirum | src/Nirum/Targets/Python.hs | gpl-3.0 | 61,835 | 0 | 18 | 19,149 | 7,082 | 3,838 | 3,244 | 643 | 4 |
-- |
-- Copyright : © 2009 CNRS - École Polytechnique - INRIA
-- License : GPL
--
-- Global site-specific configuration variables.
module Dedukti.Config where
import System.Environment (getProgName)
import System.IO.Unsafe (unsafePerformIO)
data Verbosity = Quiet | Verbose | Debug
deriving (Eq, O... | mboes/dedukti | Dedukti/Config.hs | gpl-3.0 | 1,032 | 0 | 9 | 318 | 211 | 130 | 81 | 23 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-iam/gen/Network/AWS/IAM/UpdateSigningCertificate.hs | mpl-2.0 | 4,540 | 0 | 9 | 954 | 471 | 290 | 181 | 58 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Campaigns/Update.hs | mpl-2.0 | 4,927 | 0 | 19 | 1,211 | 806 | 467 | 339 | 115 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
-- Module : Network.AWS.EC2.Metadata
-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
-- License : This Source Code Form is subject to the terms o... | brendanhay/amazonka-limited | src/Network/AWS/EC2/Metadata.hs | mpl-2.0 | 12,019 | 0 | 13 | 3,119 | 1,460 | 821 | 639 | 174 | 2 |
import Graphics.UI.Fltk.Fltk
import Graphics.UI.Fltk.Fl_Window
import Foreign.C
main = (withCString "Haskell FLTK Window" $ flWindowNew 640 480) >>= flWindowShow >> flckRun
| rebeccaskinner/fltk-haskell | tests/showWindow.hs | lgpl-3.0 | 174 | 0 | 9 | 21 | 48 | 27 | 21 | 4 | 1 |
import Control.Concurrent (forkIO, putMVar, takeMVar, newEmptyMVar)
import Control.Exception (handle)
import Control.Monad (forever)
import qualified Data.ByteString.Lazy as L
-- Provided by the 'zlib' package on http://hackage.haskell.org/
import Codec.Compression.GZip (compress)
-- NOTE readline needs GUN readline ... | Numberartificial/Realworld-Haskell | code/Ch23/Compressor.hs | apache-2.0 | 1,351 | 0 | 17 | 343 | 336 | 167 | 169 | 29 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Codegen where
import Data.Word
import Data.String
import Data.List
import Data.Function
import qualified Data.Map as Map
import Control.Monad.State
import Control.Applicative
import LLVM.General.AST
import LLVM.General.AST.Global
... | sys1yagi/scheme-haskell-llvm | Codegen.hs | apache-2.0 | 8,266 | 0 | 13 | 1,670 | 2,546 | 1,353 | 1,193 | 179 | 2 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
import Control.Arrow (second)
import Control.Monad (when, join)
import System.Directory (doesFileExist, removeFile)
import Data.List (elemIndex)
import Data.Maybe (maybeToList)
import qualified Graphics.X11.Xlib (Rectangle(..))
import Codec.Binary.UTF8.String (... | nkoep/dotfiles | xmonad/.xmonad/xmonad.hs | apache-2.0 | 5,608 | 14 | 17 | 1,374 | 1,571 | 872 | 699 | 149 | 1 |
-- http://www.codewars.com/kata/5551dc71101b2cf599000023
module Codewars.Kata.Pizza where
maxPizza :: Integer -> Maybe Integer
maxPizza n
| n < 0 = Nothing
| otherwise = Just $ n * (n + 1) `div` 2 + 1 | Bodigrim/katas | src/haskell/6-Pizza-pieces.hs | bsd-2-clause | 209 | 0 | 10 | 41 | 72 | 38 | 34 | 5 | 1 |
--
-- Copyright (c) 2013, Carl Joachim Svenn
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyright notice... | karamellpelle/MEnv | source/GUI/Widget/NumberWidget.hs | bsd-2-clause | 7,636 | 0 | 19 | 2,619 | 1,348 | 716 | 632 | 141 | 7 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QPolygonF.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:32
Warning : this file is machine generated - do not... | uduki/hsQt | Qtc/Core/QPolygonF.hs | bsd-2-clause | 8,001 | 0 | 15 | 1,325 | 2,519 | 1,290 | 1,229 | -1 | -1 |
{- Temporary workaround for https://ghc.haskell.org/trac/ghc/ticket/9127 -}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types... | snapframework/snap-core | src/Snap/Internal/Test/RequestBuilder.hs | bsd-3-clause | 37,130 | 0 | 19 | 10,233 | 5,752 | 3,175 | 2,577 | 492 | 4 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.Compatibility41
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable
--
... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Compatibility41.hs | bsd-3-clause | 48,863 | 0 | 4 | 6,755 | 6,721 | 4,488 | 2,233 | 2,228 | 0 |
module Main where
import TestData
import Control.Monad
import Data.Char (isLetter)
import qualified Data.IntMap as IMap
import Data.List
import Data.Proxy
import Data.Typeable
import Options.Applicative
import System.Directory
import System.Environment
import System.Exit
import System.FilePath ((</>))
import System.I... | ben-schulz/Idris-dev | test/TestRun.hs | bsd-3-clause | 3,875 | 0 | 14 | 818 | 940 | 507 | 433 | 75 | 4 |
{-# LANGUAGE NamedFieldPuns #-}
import Control.Monad
import Data.Char
import Data.List
import Data.Maybe
import Data.STRef
import Control.Monad.ST
import Debug.Trace
data RNode = RNode { rd :: Char
, rl :: Int
, rr :: Int
, rIsRoot :: Bool
} ... | y-usuzumi/survive-the-course | www.icourse163.org/ZJU-93001/第三周编程作业/1.hs | bsd-3-clause | 2,201 | 0 | 20 | 803 | 829 | 434 | 395 | 60 | 3 |
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Rope.Operators.Zipping
(zipWithLTS)
where
import Data.Rope.Rope
import Debug.Trace (trace, traceEvent)
import qualified Data.Rope.Seq as Seq
import Data.Rope.Seq (Progress(..), Seq, ZipProgress(..))
import Control.Monad.Par
import Prelude hiding (length, sp... | kairne/repa-lts | Data/Rope/Operators/Zipping.hs | bsd-3-clause | 15,234 | 0 | 17 | 5,486 | 4,993 | 2,596 | 2,397 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
-- |
-- Module : Text.Syntax.Printer.List
-- Copyright : 2012 Kei Hibino
-- License : BSD3
--
-- Maintainer : ex8k.hibino@gmail.com
-- Stability : experimental
-- Portability : unknown
--
-- This module includes a naive printer imp... | khibino/haskell-invertible-syntax-poly | src/Text/Syntax/Printer/List.hs | bsd-3-clause | 2,774 | 0 | 11 | 566 | 633 | 362 | 271 | 41 | 1 |
-----------------------------------------------------------------------------
--
-- Pretty-printing assembly language
--
-- (c) The University of Glasgow 1993-2005
--
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (pprNatCmmDecl) where... | sdiehl/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | 28,723 | 0 | 22 | 10,283 | 8,700 | 4,245 | 4,455 | 745 | 44 |
module Reflex.Stripe.Elements.Types where
import Control.Lens ((^.))
import Control.Lens.TH (makeLenses, makePrisms)
import Control.Monad ((<=<))
import Control.Monad.Trans (liftIO)
import Data.Default (Default, def)
import Data.Foldable (for_)
import Data.Functor (void)
import Data.Maybe (fromMaybe, listToMaybe)
impo... | ConferHealth/reflex-stripe | src/Reflex/Stripe/Elements/Types.hs | bsd-3-clause | 12,487 | 0 | 19 | 2,519 | 2,736 | 1,395 | 1,341 | -1 | -1 |
module Main where
-- import Control.Applicative
import Control.Concurrent.Chan
import Control.Concurrent hiding (yield)
import Control.Monad hiding (forever)
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.State
import Data.List
import qualified Graphics.UI.SDL as SDL
import... | strager/reactive-thread | examples/sdl/Main.hs | bsd-3-clause | 4,287 | 0 | 18 | 1,178 | 1,568 | 772 | 796 | 133 | 5 |
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.LAPACK.Types
-- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com>
-- License : BSD3
-- Maintainer : Patrick Perry <patperry@gmail.com>
-- Stability : experimental
--
module Foreign.LAPACK.Ty... | patperry/hs-linear-algebra | lib/Foreign/LAPACK/Types.hs | bsd-3-clause | 2,531 | 0 | 20 | 956 | 543 | 296 | 247 | 56 | 3 |
module Integration where
import Control.Exception.Base (finally, catch, IOException )
import System.Directory ( removeFile, removeDirectory, getTemporaryDirectory
, copyFile )
import System.FilePath ( (</>) )
import System.Process ( rawSystem )
import System.Exit ( ExitCode(..) )
import... | creswick/Newt | tests/src/Integration.hs | bsd-3-clause | 6,393 | 0 | 16 | 2,505 | 1,090 | 582 | 508 | 90 | 1 |
module Vulkan.Utils.ShaderQQ.Backend.Shaderc.Internal
( compileShaderQ
, compileShader
) where
import Control.Monad.IO.Class
import Data.ByteString ( ByteString )
import qualified Data.ByteString as BS
import Data.FileEmbed
import Language.Hask... | expipiplus1/vulkan | utils/src/Vulkan/Utils/ShaderQQ/Backend/Shaderc/Internal.hs | bsd-3-clause | 3,314 | 0 | 19 | 903 | 666 | 362 | 304 | 62 | 6 |
{-# LANGUAGE DeriveDataTypeable #-}
-- | The types types that we use in Ghcid
module Language.Haskell.Ghcid.Types(
GhciError(..),
Stream(..),
Load(..), Severity(..), EvalResult(..),
isMessage, isLoading, isLoadConfig
) where
import Data.Data
import Control.Exception.Base (Exception)
-- | GHCi shu... | ndmitchell/ghcid | src/Language/Haskell/Ghcid/Types.hs | bsd-3-clause | 2,537 | 0 | 9 | 581 | 486 | 294 | 192 | 47 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module MateVMRuntime.MethodPool
( lookupMethodEntry
, executeFuncPtr
) where
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy as B
import Da... | LouisJenkinsCS/Minimal-JVM | MateVMRuntime/MethodPool.hs | bsd-3-clause | 7,408 | 0 | 29 | 1,825 | 1,853 | 949 | 904 | 145 | 4 |
{-# LANGUAGE GADTs#-}
module Data.Linear where
import Prelude (Show(..), Eq(..))
import Data.Bool(Bool(..), bool)
id :: a ⊸ a
id a = a
liftUnit :: a ⊸ () ⊸ a
liftUnit a () = a
flip :: (a ⊸ b ⊸ c ) ⊸ b ⊸ a ⊸ c
flip f b a = f a b
infixr 0 $
($) :: (a ⊸ b) ⊸ a ⊸ b
f $ x = f x
{-# INLINE ($) #-}
(.) :: (b ⊸ c) ⊸ (... | m0ar/safe-streaming | src/Data/Linear.hs | bsd-3-clause | 860 | 0 | 8 | 212 | 400 | 220 | 180 | -1 | -1 |
module Main where
import Build_doctests (autogen_dir, deps)
import Control.Applicative
import Control.Monad
import Data.List
import System.Directory
import System.FilePath
import Test.DocTest
import Prelude
main :: IO ()
main = getSources >>= \sources -> doctest $
"-isrc"
: ("-i" ++ autogen_dir)
: "-optP-incl... | HuwCampbell/machines | tests/doctests.hs | bsd-3-clause | 887 | 0 | 14 | 157 | 301 | 162 | 139 | 26 | 1 |
{-# LANGUAGE StandaloneDeriving, TypeSynonymInstances, FlexibleInstances,
MultiParamTypeClasses, UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Trans.Crtn
-- Copyright : (c) 2012 Ian-Woo Kim
--
-- License : ... | wavewave/coroutine-object | src/Control/Monad/Trans/Crtn.hs | bsd-3-clause | 3,994 | 0 | 17 | 918 | 923 | 504 | 419 | 53 | 3 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Functions for implementing an Oz server.
module Network.Oz.Server
( authenticate
, authenticateExpired
, authenticate'
, CheckExpiration(..)
) where
import Control.Monad (when)
import Control.Monad.I... | rvl/hsoz | src/Network/Oz/Server.hs | bsd-3-clause | 3,339 | 0 | 17 | 853 | 795 | 429 | 366 | 55 | 3 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Misc.Commons where
import Control.Applicative
import Control.Monad (liftM, liftM2, ap, mzero, mplus)
import Control.Monad.Identity
import Data.Char
import Text.ParserCombinators.Parsec hiding (many, optional, (<|>))
import Text.ParserCombinators.Parsec.... | sebastiaanvisser/orchid-doc | src/Misc/Commons.hs | bsd-3-clause | 4,127 | 0 | 16 | 945 | 1,683 | 896 | 787 | 95 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns, PatternGuards #-}
{-# LANGUAGE FlexibleContexts, ConstraintKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# OPTIONS_GHC -Wall #-}
-- {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- TEMP
-- {-# OPTIONS_GHC -fno-warn-unused-binds #-} -- TEMP
-----------------------------------... | conal/lambda-ccc | src/LambdaCCC/Unused/Standard.hs | bsd-3-clause | 8,621 | 0 | 14 | 1,718 | 1,471 | 806 | 665 | 95 | 2 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
module Stack.Setup.Installed
( getCompilerVersion
, markInstalled
, unmarkInstalled
, listInstalled
, Tool (..)
, toolString
, to... | Heather/stack | src/Stack/Setup/Installed.hs | bsd-3-clause | 6,968 | 0 | 20 | 2,142 | 1,910 | 990 | 920 | 156 | 6 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances,
UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables,
TypeOperators, TypeSynonymInstances, TypeFamilies #-}
class W a b where w :: a -> b
class S a b where s :: a -> b
class (S a (Intermediate a c), W (Interme... | vs-team/Papers | Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/Src/Experiments/FunctorsSolution.hs | mit | 730 | 0 | 9 | 156 | 288 | 155 | 133 | 17 | 1 |
{-|
Module : Language.Qux.Annotated.NameResolver
Description : Name resolving functions that transform the abstract syntax tree to a name-resolved one.
Copyright : (c) Henry J. Wylde, 2015
License : BSD3
Maintainer : hjwylde@gmail.com
Name resolving functions that transform the abstract syntax tree to a n... | hjwylde/qux-haskell | src/Language/Qux/Annotated/NameResolver.hs | bsd-3-clause | 6,052 | 0 | 17 | 1,392 | 1,750 | 884 | 866 | 90 | 2 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Run commands in a nix-shell
module Stack.Nix
(reexecWithOptionalShell
,nixCmdName
,nixHelpOptName
) where
import Control.App... | phadej/stack | src/Stack/Nix.hs | bsd-3-clause | 6,676 | 0 | 22 | 1,996 | 1,368 | 745 | 623 | 134 | 4 |
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, UnboxedTuples #-}
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2007
--
-- Running statements interactively
--
-- -------------------------------------------------------------------------... | holzensp/ghc | compiler/main/InteractiveEval.hs | bsd-3-clause | 41,736 | 280 | 29 | 11,903 | 8,647 | 4,531 | 4,116 | 2 | 0 |
{-|
Module : Idris.Docstrings
Description : Wrapper around Markdown library.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable,
ScopedTypeVariables #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
mod... | uuhan/Idris-dev | src/Idris/Docstrings.hs | bsd-3-clause | 14,583 | 0 | 14 | 4,172 | 4,728 | 2,383 | 2,345 | 230 | 17 |
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-}
module YesodCoreTest.StubUnsecured
( App ( App )
, Widget
, resourcesApp
) where
import Yesod.Core
data App = App
mkYesod "App" [parseRoutes|
/ HomeR GET
|]
instance Yesod App
getHomeR :: Handler H... | psibi/yesod | yesod-core/test/YesodCoreTest/StubUnsecured.hs | mit | 426 | 0 | 5 | 101 | 73 | 44 | 29 | 15 | 1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="da-DK">
<title>FuzzDB Files</title>
<maps>
<homeID>fuzzdb</homeID>
<mapref location="ma... | kingthorin/zap-extensions | addOns/fuzzdb/src/main/javahelp/help_da_DK/helpset_da_DK.hs | apache-2.0 | 960 | 77 | 66 | 156 | 407 | 206 | 201 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="ko-KR">
<title>Advanced SQLInjection Scanner</title>
<maps>
<homeID>sqliplugin</homeID>
... | thc202/zap-extensions | addOns/sqliplugin/src/main/javahelp/help_ko_KR/helpset_ko_KR.hs | apache-2.0 | 981 | 77 | 66 | 157 | 409 | 207 | 202 | -1 | -1 |
module Demote.MultiLeg where
data Constraint = Include String
| Exclude String
deriving (Show)
is_excluded stringQueueName (Include regex) = do
reg <- mkr regex
return True
is_excluded stringQueueName (Exclude regex) = do
reg <- mkr regex
return False
mkr reg = show reg
| RefactoringTools/HaRe | test/testdata/Demote/MultiLeg.hs | bsd-3-clause | 313 | 0 | 8 | 84 | 102 | 49 | 53 | 11 | 1 |
module UnitTests.Distribution.Client.GZipUtils (
tests
) where
import Codec.Compression.GZip as GZip
import Codec.Compression.Zlib as Zlib
import Control.Exception.Base (evaluate)
import Control.Exception (try, SomeException)
import Control.Monad ... | rimmington/cabal | cabal-install/tests/UnitTests/Distribution/Client/GZipUtils.hs | bsd-3-clause | 2,898 | 0 | 16 | 669 | 668 | 361 | 307 | 49 | 1 |
{-# LANGUAGE TypeFamilies, EmptyDataDecls, FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
module NonLinearLHS where
type family E a b
type instance E a a = [a]
foo :: E [Int] (E Int Int) -> Int
foo = sum . concat
data family F a b
data instance F... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs | bsd-3-clause | 826 | 0 | 8 | 169 | 295 | 160 | 135 | -1 | -1 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens
-- Copyright : (C) 2012-15 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : experimental
-- Portabi... | rpglover64/lens | src/Control/Lens.hs | bsd-3-clause | 2,820 | 0 | 5 | 428 | 346 | 255 | 91 | 46 | 0 |
-- Test purpose:
-- Ensure that using -Wno-compat does not switch on warnings
{-# OPTIONS_GHC -Wno-compat #-}
{-# LANGUAGE CPP #-}
#include "Template.hs"
| sdiehl/ghc | testsuite/tests/wcompat-warnings/WCompatWarningsOff.hs | bsd-3-clause | 155 | 0 | 2 | 24 | 7 | 6 | 1 | 2 | 0 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE CPP, ForeignFunctionInterface, MagicHash, UnboxedTuples #-}
-----------------------------------------------------------------------------
-- |
-- Module : Debug.Trace
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base... | beni55/haste-compiler | libraries/ghc-7.8/base/Debug/Trace.hs | bsd-3-clause | 6,486 | 0 | 13 | 1,281 | 633 | 371 | 262 | 60 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
{-# LANGUAGE DeriveDataTypeable #-}
module EntityEmbedTest where
-- because we ar... | pseudonom/persistent | persistent-test/src/EntityEmbedTest.hs | mit | 579 | 0 | 5 | 82 | 35 | 24 | 11 | 4 | 0 |
import Control.Monad
take' :: Int -> [a] -> [a]
take' 0 _ = []
take' n [] = []
take' n (x:xs) = x : take' (n-1) xs
main :: IO ()
main = do
forM_ [1..5] $ \i -> print i
forM_ (take' 5 [1..]) $ \i -> print i
forM_ [1,3..9] $ \i -> print i
forM_ (take' 3 [1,3..]) $ \i -> print i
| beni55/ghcjs | test/fay/enumFrom.hs | mit | 304 | 0 | 11 | 94 | 209 | 106 | 103 | 11 | 1 |
module T9006a( T )where
data T = T
| urbanslug/ghc | testsuite/tests/rename/should_fail/T9006a.hs | bsd-3-clause | 36 | 0 | 5 | 9 | 16 | 10 | 6 | 2 | 0 |
-- |
-- This module provides a low-level effectful API dealing with the connections to the database.
module Hasql.Connection
(
Connection,
ConnectionError(..),
acquire,
release,
Settings,
settings,
withLibPQConnection
)
where
import Hasql.Private.Connection
import Hasql.Private.Settings
| nikita-volkov/hasql | library/Hasql/Connection.hs | mit | 303 | 0 | 5 | 48 | 47 | 32 | 15 | 11 | 0 |
trimInit :: [a] -> Int -> [a]
trimInit [] _ = []
trimInit l@(h:t) p | p == 0 = l
| otherwise = trimInit t (p - 1)
{- Run-length encoding of a list. -}
runLengthEncoding :: (Eq a) => [a] -> [(Int, a)]
runLengthEncoding [] = []
runLengthEncoding [x] = [(1, x)]
runLengthEncoding l@(h:t) = (len, h):runL... | andrewaguiar/s99-haskell | p10.hs | mit | 518 | 0 | 10 | 196 | 221 | 119 | 102 | 11 | 1 |
import Data.Monoid
type Verb = String
type Adjective = String
type Adverb = String
type Noun = String
type Exclamation = String
madlibbin' :: Exclamation
-> Adverb
-> Noun
-> Adjective
-> String
madlibbin' e adv noun adj = mconcat [e , "! he said" ,
... | diminishedprime/.org | reading-list/haskell_programming_from_first_principles/15_11.hs | mit | 495 | 0 | 8 | 225 | 98 | 58 | 40 | 15 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module EDDA.Data.Subscriber where
import Control.Concurrent
import Control.Monad
import Control.Monad.Loops
import Control.Monad.Trans.Reader
import Control.Concurrent.MVar
import System.Exit
import System.IO
import System.Environment
import System.ZMQ4.... | troydm/edda | src/EDDA/Data/Subscriber.hs | mit | 4,236 | 0 | 23 | 1,541 | 913 | 465 | 448 | 78 | 4 |
{-# LANGUAGE KindSignatures, RankNTypes, TypeOperators #-}
module Data.HTraversable where
import Data.HTypes
import Data.HFunctor
-- import Data.HFoldable
{-| higher-order Traversable.
-}
class (HFunctor h) => HTraversable (h :: (* -> *) -> (* -> *)) where
-- class (HFunctor h, HFoldable h) => HTraversable (h ::... | sboosali/commands-core | sources/Data/HTraversable.hs | mit | 971 | 0 | 13 | 182 | 187 | 102 | 85 | 10 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-- | Provides a dummy authentication module that simply lets a user specify
-- their identifier. T... | yesodweb/yesod | yesod-auth/Yesod/Auth/Dummy.hs | mit | 2,476 | 0 | 16 | 686 | 387 | 217 | 170 | 36 | 4 |
import Data.Array
import qualified Data.Ix as Ix
import Data.Text (Text)
import qualified Data.Text as Text
import qualified Data.Text.IO as IO
import Text.Parsec
import Text.Parsec.Text
data Instruction
= Copy Value Register
| Increment Register
| Decrement Register
| Jump Value Value
| Toggle Value
| Inv... | SamirTalwar/advent-of-code | 2016/AOC_23_1.hs | mit | 4,063 | 0 | 16 | 889 | 1,470 | 751 | 719 | -1 | -1 |
-- 8. Making our own Types & Typeclasses
-- 1. Into to algebraic data types --
-------------------------------------
data Bool = False | True -- 'data' defines a new type
-- False | True are 'value constructors'
-- '|' can be read as 'or'
-- How might we define a ... | supermitch/learn-haskell | learn-you-a-haskell/8-chapter.hs | mit | 6,392 | 61 | 16 | 1,551 | 1,317 | 739 | 578 | -1 | -1 |
module Main where
import Control.Applicative
import Control.Concurrent (threadDelay)
import qualified Data.Text as T
import System.Environment (getArgs)
import Bot
import Markov
import Tweet
main :: IO ()
main = do
argPairs <- zip <*> tail <$>... | 5outh/rapcandy | src/RapCandy.hs | mit | 934 | 0 | 21 | 312 | 245 | 119 | 126 | 28 | 5 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.Urho3D.Math.Rect(
Rect(..)
, IntRect(..)
, rectContext
-- | Lens API
, HasMinPoint(..)
, HasMaxPoint(..)
, HasLeft(..)
, HasTop(..)
, HasRight(..)
, HasBottom(..)
) where
import qualified Language.C.Inline as C
import qualified Language.C.I... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Math/Rect.hs | mit | 5,239 | 0 | 12 | 1,042 | 1,925 | 1,018 | 907 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
module Control.Event ( Event(..), recognizes ) where
import Internal
import Control.Applicative hiding ( (<|>) )
import Control.Dangerous
import Control.DateTime.Calculation ( Calculation(..) )
import Control.DateTime.Absolute hiding ( normalize )
import Control.Unit ( Unit, block )
i... | Soares/tagwiki | src/Control/Event.hs | mit | 1,801 | 0 | 13 | 394 | 582 | 319 | 263 | 46 | 1 |
module Rebase.Data.Functor.Identity
(
module Data.Functor.Identity
)
where
import Data.Functor.Identity
| nikita-volkov/rebase | library/Rebase/Data/Functor/Identity.hs | mit | 107 | 0 | 5 | 12 | 23 | 16 | 7 | 4 | 0 |
module AppManagedEntity.Schema
( module AppManagedEntity.Schema
, module AppManagedEntity.Schema.Virus
) where
import qualified Database.Orville.PostgreSQL as O
import AppManagedEntity.Schema.Virus
schema :: O.SchemaDefinition
schema = [O.Table virusTable]
| flipstone/orville | orville-postgresql/test/AppManagedEntity/Schema.hs | mit | 266 | 0 | 7 | 33 | 56 | 36 | 20 | 7 | 1 |
import Data.List (sortBy, foldl, group)
main = do
str <- readFile "Problem0054.txt"
print $ problem54Value str
-- split the input string into lines, determine if player 1 wins for each line, and return the number of times player 1 won
problem54Value :: String -> Int
problem54Value str = length $ filter player... | jchitel/ProjectEuler.hs | Problems/Problem0054.hs | mit | 4,882 | 0 | 12 | 1,683 | 968 | 531 | 437 | 40 | 6 |
{-# LANGUAGE OverloadedStrings #-}
module Deploy.Core (
ssh,
command,
Command(),
AppName, Repository, VirtualEnv, CloneName,
echo', clone, cd, ls,
workon, mkvirtualenv, manage,
verify, if', export', quit,
run,
module Turtle,
module Turtle.Format,
) where
import Prelude hi... | mdsn/deploy | src/Deploy/Core.hs | gpl-2.0 | 2,199 | 0 | 12 | 496 | 725 | 394 | 331 | 59 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Codec.Picture
import Codec.Picture.Saving
import Control.Arrow
import Control.Monad
import Control.Monad.Writer.Strict
import qualified Data.ByteString.Lazy as B
import Data.Foldable (foldrM)
import... | matthiasgoergens/static-sorting-visualisation | app/Main.hs | gpl-3.0 | 1,988 | 0 | 20 | 392 | 631 | 339 | 292 | 53 | 7 |
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}
import Control.Applicative ((<$>), (<*>))
import Control.Monad (liftM2)
import Data.Aeson
import Data.List (sortBy)
import Data.Maybe
import Data.Yaml
import Database.HDBC
import Database.HDBC.PostgreSQL
import GHC.Generics
import Data.Monoid ((<>))
import System.Direc... | twopoint718/rails_doctor | rails_doctor.hs | gpl-3.0 | 2,379 | 0 | 15 | 548 | 717 | 371 | 346 | 62 | 3 |
items = ["data", "newtype", "where","in","let","case", "of"]
types = ["Int", "CHar", "Bool","String"] | YPBlib/NaiveFunGame_hs | zju_lambda/recognizer.hs | gpl-3.0 | 101 | 0 | 5 | 10 | 44 | 28 | 16 | 2 | 1 |
----------------------------------------------------------------------------
-- |
-- Module : $Header$
-- Copyright : (c) Proyecto Theona, 2012-2013
-- (c) Alejandro Gadea, Emmanuel Gunther, Miguel Pagano
-- License : <license>
--
-- Maintainer : miguel.pagano+theona@gmail.com
-- Stabili... | alexgadea/fun | Fun/Parser/Module.hs | gpl-3.0 | 1,923 | 0 | 13 | 442 | 411 | 225 | 186 | 33 | 1 |
-- Haskell Practical 5 - Canvas
-- By James Cowgill
module Prac5.Canvas(Canvas, plus, hor, ver, overlay, render) where
import Data.List
-- A canvas is a grid where each point can be black or white
-- Stored as a list of black points
-- They do not have fixed sizes, they can expand in any direction
type Canvas = [... | jcowgill/cs-work | syac/compilers/Prac5/Canvas.hs | gpl-3.0 | 1,725 | 0 | 11 | 457 | 646 | 358 | 288 | 33 | 1 |
module SymbolicField where
import Data.List
import Data.Map (Map, empty, filterWithKey, fromListWith, singleton, toAscList, unionWith)
newtype Monom = Monom (Map String Int)
deriving (Eq, Ord)
newtype Expr = Expr (Map Monom Integer)
deriving (Eq, Ord)
showPower 1 = ""
showPower n = "^" ++ show n
showFactor ... | maugier/cctk | src/CCTK/SymbolicField.hs | gpl-3.0 | 1,331 | 0 | 13 | 311 | 658 | 337 | 321 | 34 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.