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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
import Test.Hspec
import qualified Jenkins.TypesSpec as TypesSpec
main :: IO ()
main = hspec TypesSpec.test
| afiore/jenkins-tty.hs | test/Suite.hs | mit | 109 | 0 | 6 | 16 | 34 | 19 | 15 | 4 | 1 |
{-# LANGUAGE BangPatterns #-}
module LMisc (zipp, zipp4, tokens, tokens', in2out, rDoubleS
, findWithRemainder ,differentiateBy,findWithAdjs
, takeFirst, mtone3, subs, subsN, choose, force
,ascending,nppP
, allPieces, nPieces, adjustMatrix , myMin
,... | rawlep/EQS | sourceCode/LMisc.hs | mit | 34,881 | 0 | 17 | 12,589 | 12,042 | 6,411 | 5,631 | 523 | 5 |
module GameTypes.ServerGame where
import Net.Communication (open, accept, receive, send)
import Net.Protocol (Message(..))
import Players.RemotePlayer (RemotePlayer(..))
import Players.LocalPlayer (LocalPlayer(..))
import Network.Socket (sClose)
import System.IO
import TicTacToe (Token(..))
-- close... | davidarnarsson/tictactoe | GameTypes/ServerGame.hs | mit | 1,187 | 0 | 14 | 310 | 351 | 185 | 166 | 26 | 1 |
module Util.PrettyPrint
( PrettyPrint(..)
, Util.PrettyPrint.print
, Out
, pprName
, nil
, str
, num
, append
, newline
, indent
, Util.PrettyPrint.concat
, interleave
) where
-- Data type for Output
data Out
= Str String
| Newline
| Indent Out
| Nil
| Append Out Out
-- helpers
ni... | tadeuzagallo/verve-lang | src/Util/PrettyPrint.hs | mit | 1,635 | 0 | 9 | 381 | 691 | 384 | 307 | 58 | 1 |
-----------------------------------------------------------------------------
--
-- Module : TypeNum.TypeFunctions
-- Copyright :
-- License : MIT
--
-- Maintainer : -
-- Stability :
-- Portability :
--
-- |
--
{-# LANGUAGE PolyKinds, ConstraintKinds #-}
module TypeNum.TypeFunctions (
-- * Types eq... | fehu/TypeNumerics | src/TypeNum/TypeFunctions.hs | mit | 9,940 | 34 | 12 | 2,132 | 3,837 | 2,279 | 1,558 | -1 | -1 |
import Data.List (maximumBy)
import MyLib (fact,numOfDgt)
main = print $ answer 1000
answer n = sndmax (cycs n)
-- sndmax [(2,0),(0,5),(3,1)]==(0,5)
-- sndmax [(2,0),(0,2),(3,3)]==(3,3)
sndmax :: Ord a => [(b,a)] -> (b,a)
sndmax = maximumBy (\(x,y) (z,w)->compare y w)
-- cycs 3 == []
cycs :: Integral a => a -> [(a,... | yuto-matsum/contest-util-hs | src/Euler/026.hs | mit | 1,181 | 0 | 11 | 297 | 567 | 297 | 270 | 28 | 2 |
module GHCJS.DOM.RTCIceCandidateEvent (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/RTCIceCandidateEvent.hs | mit | 50 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
----------------------------------------------------------------------------
---- |
---- Module: ETL
---- Description: Transform scrabble scores from [(score: [letter])] map to
---- [(letter:score)] map
---- Copyright: (c) 2015 Alex Dzyoba <alex@dzyoba.com>
---- License: MIT
-----------------------------... | dzeban/haskell-exercism | etl/ETL.hs | mit | 1,388 | 0 | 7 | 216 | 214 | 123 | 91 | 13 | 1 |
import Data.ByteString.Char8 (pack)
import Crypto.Hash
main = do
let input = "vkjiggvb"
result = compute input
print result
type Coord = (Int, Int)
type Dir = Char
type State = (Coord, [Dir], String)
bounds :: Int
bounds = 3
start :: Coord
start = (0,0)
initState :: St... | aBhallo/AoC2016 | Day 17/day17part2.hs | mit | 1,805 | 0 | 10 | 501 | 882 | 484 | 398 | 48 | 5 |
module Solidran.Lexf.DetailSpec (spec) where
import Test.Hspec
import Solidran.Lexf.Detail
spec :: Spec
spec = do
describe "Solidran.Lexf.Detail" $ do
describe "getAlphabetStrings" $ do
it "should return an empty list on empty alphabet" $ do
getAlphabetStrings 2 []
... | Jefffrey/Solidran | test/Solidran/Lexf/DetailSpec.hs | mit | 1,105 | 0 | 18 | 464 | 243 | 130 | 113 | 25 | 1 |
import State (Token(..), State(..), TransitionFunction(..), Transition(..), TransitionMap)
import qualified NDFSM (NDFSM(..))
import NDFSM (NDFSM, NDState, exploreTransitions, flatten, tabulate, acceptsState, eps)
import qualified FSM (FSM(..))
import FSM (FSM, mapTransitions, mapToFunc, accepts)
import qualified Data.... | wyager/NDFSMtoFSM | StateMachine.hs | mit | 1,601 | 16 | 13 | 295 | 466 | 268 | 198 | 32 | 1 |
{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE DataKinds ... | nickspinale/bigword | tests/Properties.hs | mit | 5,100 | 0 | 13 | 1,073 | 1,473 | 824 | 649 | 112 | 1 |
{-|
Module : DataAssociation.Abstract
Description : Rules mining abstractions.
License : MIT
Stability : development
Rules mining abstractions.
-}
module DataAssociation.Abstract (
LargeItemsetsExtractor(..)
, AssociationRulesGenerator(..)
) where
import DataAssociation.Definitions
import Data.Map... | fehu/min-dat--a-priori | core/src/DataAssociation/Abstract.hs | mit | 1,277 | 0 | 12 | 387 | 163 | 92 | 71 | -1 | -1 |
{-# OPTIONS_GHC -Wall #-}
-- {-# LANGUAGE DatatypeContexts #-}
module ApplicativeFunctors where
-- import Prelude hiding (Maybe)
-- import Data.Maybe hiding (Maybe)
import Control.Applicative
type Name = String
data Employee = Employee
{ name :: Name
, phone :: String }
... | harrisi/on-being-better | list-expansion/Haskell/Learning/ApplicativeFunctors.hs | cc0-1.0 | 873 | 0 | 8 | 218 | 166 | 102 | 64 | 19 | 1 |
{- This module was generated from data in the Kate syntax
highlighting file rust.xml, version 1.1, by -}
module Text.Highlighting.Kate.Syntax.Rust
(highlight, parseExpression, syntaxName, syntaxExtensions)
where
import Text.Highlighting.Kate.Types
import Text.Highlighting.Kate.Common
import Text.ParserCo... | ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Rust.hs | gpl-2.0 | 12,776 | 0 | 42 | 1,886 | 3,205 | 1,697 | 1,508 | 212 | 15 |
{- |
Module : ./Static/ToJson.hs
Description : json output of Hets development graphs
Copyright : (c) Christian Maeder, DFKI GmbH 2014
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : non-portable(Grothendieck)
Json of Hets DGs
... | gnn/Hets | Static/ToJson.hs | gpl-2.0 | 9,841 | 0 | 33 | 3,012 | 3,243 | 1,648 | 1,595 | 217 | 9 |
{-# OPTIONS_GHC -Wall -fwarn-tabs -Werror #-}
-------------------------------------------------------------------------------
-- |
-- Module : World
-- Copyright : Copyright (c) 2014 Michael R. Shannon
-- License : GPLv2 or Later
-- Maintainer : mrshannon.aerospace@gmail.com
-- Stability : unstable
... | mrshannon/trees | src/World.hs | gpl-2.0 | 917 | 0 | 9 | 211 | 125 | 86 | 39 | 19 | 1 |
module Main (main) where
import Language.Haskell.HLint (hlint)
import System.Exit (exitFailure, exitSuccess)
arguments :: [String]
arguments =
[ "parse-packages"
, "src"
, "test"
]
main :: IO ()
main = do
hints <- hlint arguments
if null hints then exitSuccess e... | vikraman/packages-ng | test/HLint.hs | gpl-2.0 | 336 | 0 | 8 | 99 | 94 | 54 | 40 | 12 | 2 |
module Test (tests) where
import Data.Time
import Data.Time.Format
import Data.Time.LocalTime
import Main
import System.Locale
import Test.HUnit
sampleTime :: ParseTime t => Int -> t
sampleTime n = times !! n
where times = map readLocalTime [ ("%F", "2014-06-21")
, ("%F %R", "20... | Yuhta/hs-gcal2org | Test.hs | gpl-3.0 | 1,991 | 0 | 10 | 634 | 423 | 228 | 195 | 50 | 1 |
{-| Module : Args
License : GPL
Maintainer : helium@cs.uu.nl
Stability : experimental
Portability : portable
-}
module Helium.Main.Args
( Option(..)
, processHeliumArgs
, processRunHeliumArgs
, processTexthintArgs
, lvmPathFromOptions
, basePathFromOptions
... | roberth/uu-helium | src/Helium/Main/Args.hs | gpl-3.0 | 18,762 | 0 | 17 | 5,372 | 3,946 | 2,045 | 1,901 | 263 | 8 |
module Data.Automaton where
data Automaton state input output = Automaton
{ initialState :: state
, transitions :: [(state,input,state,output)]
} deriving (Eq,Show)
| svenkeidel/hsedit | src/Data/Automaton.hs | gpl-3.0 | 173 | 0 | 10 | 29 | 56 | 36 | 20 | 5 | 0 |
module Main where
import Utils.All
import Assets
import Lib
import Repl
import ArgumentParser
import System.Environment
import System.IO
import Data.Char
import Data.List
import Control.Monad
versionCount = [0,2,0,4]
versionMessage = "Hi Reddit! Stuff should actually work now..."
version = (versionCount, versio... | pietervdvn/ALGT2 | app/Main.hs | gpl-3.0 | 844 | 21 | 9 | 152 | 256 | 140 | 116 | 25 | 2 |
{-# LANGUAGE Arrows #-}
module SIRTests
( sirPropTests
) where
import Data.List
import Data.Maybe
import Data.Void
import FRP.Yampa
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import SIR.SIR
import SIR.Utils
import StatsUtils
import Debug.Trace
instance Arbitrary SIRState where
-- arbitrary :: Gen ... | thalerjonathan/phd | public/propabs/sir/src/test/SIRTests.hs | gpl-3.0 | 9,716 | 2 | 14 | 3,139 | 1,711 | 915 | 796 | 164 | 5 |
-- | Sugared evaluation results
{-# LANGUAGE TemplateHaskell #-}
module Lamdu.Sugar.Types.Eval
( EvalScopes
, ParamScopes, EvaluationScopes
, ScopeId
, ER.EvalTypeError(..)
, ER.CompiledErrorType(..)
, ER._DependencyTypeOutOfDate, ER._ReachedHole, ER._UnhandledCase
, ER.Error(..), ER._Co... | Peaker/lamdu | src/Lamdu/Sugar/Types/Eval.hs | gpl-3.0 | 3,538 | 0 | 13 | 752 | 904 | 549 | 355 | -1 | -1 |
module HMeans.Common where
import Data.Clustering.Hierarchical
import qualified Data.IntSet as ISet
import qualified Data.IntMap.Strict as IMap
import qualified Data.Map.Strict as Map
import qualified Data.Vector.Unboxed as UV
newtype Partition a = Partition {getPartition :: IMap.IntMap (Cluster a)}
... | ehlemur/HMeans | src/HMeans/Common.hs | gpl-3.0 | 1,821 | 0 | 12 | 670 | 432 | 254 | 178 | 33 | 0 |
-- http://www.codewars.com/kata/52b757663a95b11b3d00062d
module WeIrDStRiNgCaSe where
import Data.Char
import Data.List.Split
toWeirdCase :: String -> String
toWeirdCase = unwords . map weirdise . words where
weirdise = concatMap f . chunksOf 2
f (x:xs) = toUpper x : map toLower xs | Bodigrim/katas | src/haskell/6-WeIrD-StRiNg-CaSe.hs | bsd-2-clause | 288 | 0 | 9 | 44 | 85 | 45 | 40 | 7 | 1 |
-- | Command line options.
module Options
(
-- * Options type
Options(..)
-- * Options parsing
, options
)
where
import Control.Applicative
import Options.Applicative
-- | Data type for command options.
data Options
= Options
{ inputFile :: FilePath -- ^ File to be compi... | vituscze/norri | src/Options.hs | bsd-3-clause | 1,784 | 0 | 16 | 678 | 304 | 161 | 143 | 40 | 1 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
module Control.CP.FD.OvertonFD.Sugar (
) where
import Data.Set(Set)
import qualified Data.Set as Set
import Control.CP.Debug
import Control.Mixin.Mixin
import Control.CP.Solver
import Control.CP.FD.FD
import Control.CP.FD.SimpleFD
import Data.Expr.Data
... | neothemachine/monadiccp | src/Control/CP/FD/OvertonFD/Sugar.hs | bsd-3-clause | 4,046 | 0 | 20 | 822 | 1,669 | 905 | 764 | 90 | 11 |
module Tests.WebTest
(tests)
where
import Test.HUnit
import qualified Data.DataHandler
import qualified Service.ServiceHandler
import qualified Configuration.Util
import qualified Service.Users
import qualified Web.WebHandler
import qualified Web.WebHelper
import Control.Monad.Trans.Resource
import Data.ByteStrin... | stevechy/HaskellCakeStore | Tests/WebTest.hs | bsd-3-clause | 1,143 | 0 | 17 | 145 | 242 | 130 | 112 | 25 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program
-- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This provides an abstraction which deals with configu... | IreneKnapp/Faction | libfaction/Distribution/Simple/Program.hs | bsd-3-clause | 7,075 | 0 | 10 | 1,663 | 828 | 501 | 327 | 131 | 2 |
module PolyGraph.ReadOnly.DiGraph.Properties where
import PolyGraph.ReadOnly (GMorphism(..), isValidGraphDataSet)
import PolyGraph.ReadOnly.DiGraph (DiGraph, DiEdgeSemantics(..))
import PolyGraph.Common (OPair(..), PairLike(toPair))
import qualified Data.Maybe as M
import qualified Data.Foldable as F
isValidDiGraph ... | rpeszek/GraphPlay | src/PolyGraph/ReadOnly/DiGraph/Properties.hs | bsd-3-clause | 1,308 | 0 | 10 | 323 | 352 | 198 | 154 | -1 | -1 |
module WorkerClient where
import Control.Monad
import qualified Data.Aeson as A
import Data.ByteString.Lazy.Char8
import Codec.Picture
import qualified Network.WebSockets as WS
import qualified Model as Model
import Job
import Message
-- import WebSocketServe... | CBMM/CBaaS | cbaas-server/src/WorkerClient.hs | bsd-3-clause | 1,443 | 0 | 24 | 437 | 385 | 198 | 187 | 29 | 5 |
{-# language TemplateHaskell #-}
module Phil.Core.Kinds.KindError where
import Control.Lens
import Data.Text (unpack)
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import Phil.Core.AST.Identifier
import Phil.Core.Kinds.Kind
import Phil.ErrorMsg
import Phil.Typecheck.Unification
data KindError
= KVarNotDefine... | LightAndLight/hindley-milner | src/Phil/Core/Kinds/KindError.hs | bsd-3-clause | 1,340 | 0 | 13 | 369 | 328 | 179 | 149 | 35 | 4 |
{-# LANGUAGE RankNTypes, NoMonomorphismRestriction, BangPatterns,
DeriveDataTypeable, GADTs, ScopedTypeVariables,
ExistentialQuantification, StandaloneDeriving #-}
{-# OPTIONS -Wall #-}
module Language.Hakaru.Metropolis where
import System.Random (RandomGen, StdGen, randomR, getStdGen)
import Data.Dynamic
import... | zaxtax/hakaru-old | Language/Hakaru/Metropolis.hs | bsd-3-clause | 6,619 | 0 | 19 | 1,981 | 2,789 | 1,484 | 1,305 | 152 | 4 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE FlexibleContexts #-}
module NetworkSim.LinkLayer
( -- * MAC
module NetworkSim.LinkLayer.MAC
-- * Link-layer exception
, LinkException (..)
-- * Ethernet Frame
, Frame (..)
, Payload ()
, OutFrame
, Destination ... | prophet-on-that/network-sim | src/NetworkSim/LinkLayer.hs | bsd-3-clause | 8,672 | 0 | 23 | 2,345 | 2,294 | 1,192 | 1,102 | -1 | -1 |
{-# LANGUAGE
OverloadedStrings
, BangPatterns
, ScopedTypeVariables
#-}
module RunTests where
import Control.Exception
import Data.Conduit
import Data.List (foldl')
import Data.Monoid ((<>))
import Data.Conduit.HDBI
import Database.HDBI
import Database.HDBI.SQlite
import Test.Framework
import Test.Framework.Provi... | s9gf4ult/hdbi-conduit | testsrc/runtests.hs | bsd-3-clause | 4,603 | 0 | 19 | 1,109 | 1,402 | 707 | 695 | -1 | -1 |
{-# LANGUAGE DeriveGeneric #-}
module Real.Types (module Real.Types, Version(..)) where
import GHC.Generics
newtype InstalledPackageId = InstalledPackageId String
deriving (Eq, Ord, Generic)
newtype PackageName = PackageName String
deriving (Eq, Ord, Generic)
data Version = Version [Int] [String]
derivi... | thoughtpolice/binary-serialise-cbor | bench/Real/Types.hs | bsd-3-clause | 13,470 | 0 | 13 | 4,165 | 2,320 | 1,434 | 886 | 326 | 0 |
module Paths_CipherSolver (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
cat... | abhinav-mehta/CipherSolver | dist/build/autogen/Paths_CipherSolver.hs | bsd-3-clause | 1,174 | 0 | 10 | 167 | 332 | 190 | 142 | 26 | 1 |
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, Rank2Types #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : Numeric.LinearAlgebra.Matrix.STBase
-- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com>
-- License : BSD... | patperry/hs-linear-algebra | lib/Numeric/LinearAlgebra/Matrix/STBase.hs | bsd-3-clause | 41,765 | 0 | 20 | 15,100 | 12,954 | 6,511 | 6,443 | 938 | 4 |
module Parse.IParser where
import Parse.Primitives (Parser)
import Reporting.Error.Syntax (ParsecError)
type IParser a = Parser ParsecError a
| avh4/elm-format | elm-format-lib/src/Parse/IParser.hs | bsd-3-clause | 145 | 0 | 5 | 19 | 39 | 24 | 15 | 4 | 0 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
module Node.T1w
(T1w(..)
,rules)
where
import Node.Types
import Node.Util (getPath, outdir, showKey)
import Shake.BuildNode
import ... | reckbo/ppl | pipeline-lib/Node/T1w.hs | bsd-3-clause | 939 | 0 | 15 | 294 | 286 | 154 | 132 | 30 | 1 |
-- | Tests for automatic deriving of ann method from Annotated type class.
module Language.Java.Paragon.SyntaxSpec (main, spec) where
import Test.Hspec
import Language.Java.Paragon.Annotation
import Language.Java.Paragon.Syntax
-- | To be able to run this module from GHCi.
main :: IO ()
main = hspec spec
-- | Main ... | bvdelft/paragon | test/Language/Java/Paragon/SyntaxSpec.hs | bsd-3-clause | 919 | 0 | 24 | 172 | 217 | 115 | 102 | 17 | 1 |
{-# LANGUAGE QuasiQuotes, TypeFamilies, PackageImports #-}
import Control.Arrow
import "monads-tf" Control.Monad.State
import "monads-tf" Control.Monad.Error
import Data.Maybe
import Data.Char
import System.Environment
import Text.Papillon
type List = [List1]
data List1 = Item String List deriving Show
main :: IO ()... | YoshikuniJujo/markdown2svg | tests/testParser.hs | bsd-3-clause | 1,644 | 0 | 12 | 358 | 572 | 308 | 264 | 39 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
module DataLayer
( KeyValue (..)
, insert
, find
)
where
import Control.Monad.Reader
import Control.Monad.State
import Data.Acid
import Data.SafeCopy
import Data.Typeable
impor... | wavelets/9m | src/DataLayer.hs | bsd-3-clause | 1,050 | 0 | 12 | 191 | 369 | 195 | 174 | 35 | 1 |
module Ribbon where
import Rumpus
-- Devin Chalmers remix
start :: Start
start = do
parentID <- ask
addActiveKnob "Total Speed" (Linear -5 5) 1 setClockSpeed
rotSpeedKnob <- addKnob "Rot Speed" (Linear 0 5) 1
yScaleKnob <- addKnob "YScale" (Linear 0 10) 1
zScaleKnob <- addKnob "ZScale" (Li... | lukexi/rumpus | pristine/Ribbon/RibbonRemix.hs | bsd-3-clause | 989 | 0 | 20 | 377 | 339 | 162 | 177 | 25 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Karamaan.Opaleye.TableColspec where
import Karamaan.Opaleye.Wire (Wire(Wire))
import Karamaan.Opaleye.QueryColspec (QueryColspec(QueryColspec),
runWriterOfQueryColspec,
runPackM... | dbp/karamaan-opaleye | Karamaan/Opaleye/TableColspec.hs | bsd-3-clause | 3,476 | 0 | 14 | 718 | 978 | 522 | 456 | 63 | 1 |
module Math.Simplicial.NeighborhoodGraph where
import qualified Data.Vector.Unboxed as UV
import qualified Data.Vector as BV
import qualified Math.VectorSpaces.Metric as Met
import qualified Math.Simplicial.LandmarkSelection as LS
import qualified Math.Misc.Matrix as Mat
import qualified Math.VectorSpaces.DistanceMatr... | michiexile/hplex | pershom/src/Math/Simplicial/NeighborhoodGraph.hs | bsd-3-clause | 2,787 | 0 | 17 | 724 | 1,004 | 546 | 458 | 59 | 3 |
{-# LANGUAGE CPP, GADTs #-}
-----------------------------------------------------------------------------
--
-- Pretty-printing of Cmm as C, suitable for feeding gcc
--
-- (c) The University of Glasgow 2004-2006
--
-- Print Cmm as real C, for -fvia-C
--
-- See wiki:Commentary/Compiler/Backends/PprC
--
-- This is simpl... | GaloisInc/halvm-ghc | compiler/cmm/PprC.hs | bsd-3-clause | 48,991 | 0 | 20 | 14,987 | 11,918 | 5,927 | 5,991 | 834 | 63 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ImplicitParams #-}
{-# Language OverloadedStrings #-}
{-# OPTIONS_GHC -Wall -fno-warn-unused-top-binds #-}
import qualified Data.ByteString as BS
import qualified Data.ByteString.UTF8 as BS8
import Data.Char (isSpace)
import Data.List ... | GaloisInc/saw-script | crux-mir-comp/test/Test.hs | bsd-3-clause | 9,682 | 3 | 24 | 2,580 | 2,523 | 1,300 | 1,223 | 189 | 6 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Lib
( mainFunc,
module ClassyPrelude,
module Haskakafka
) where
import Common
import Config
import Fortune
import Kansha
import Threading
import Control.Lens
import Data.Aeson
import Data.Aeson.Lens
import GHC.IO.Handle... | Koshroy/kokona | src/Lib.hs | bsd-3-clause | 5,671 | 0 | 19 | 1,128 | 1,735 | 829 | 906 | 131 | 3 |
data DT = DT Integer deriving Show
newtype NT = NT Integer deriving Show
checkDT :: DT -> String
checkDT (DT _) = "OK!"
checkNT :: NT -> String
checkNT (NT _) = "OK!"
| YoshikuniJujo/funpaala | samples/26_type_class/newtypeDiff.hs | bsd-3-clause | 170 | 0 | 7 | 37 | 70 | 38 | 32 | 6 | 1 |
{-# LANGUAGE BangPatterns, MultiParamTypeClasses #-}
{-# OPTIONS -fno-warn-orphans #-}
module Data.Digest.Groestl384 (
groestl384,
Groestl384Digest (..),
GroestlCtx,
Hash(..),
hash,
hash',
printAsHex
) w... | hakoja/SHA3 | Data/Digest/Groestl384.hs | bsd-3-clause | 1,720 | 0 | 10 | 380 | 450 | 253 | 197 | 42 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
-- | 'Lucid.HtmlT' inspired monad for creating... | louispan/glazier-react | src/Glazier/React/Markup.hs | bsd-3-clause | 5,135 | 0 | 14 | 1,002 | 731 | 415 | 316 | 71 | 1 |
{-|
Haskelm test suite
For the moment, just contains some basic tests
This file also serves as an example of how to
translate Elm from different sources
-}
{-# LANGUAGE TemplateHaskell, QuasiQuotes, MultiWayIf #-}
import Language.Elm.TH
import Data.List (intercalate)
import Control.Monad
-- | Similarly, we can loa... | JoeyEremondi/haskelm-old | tests/Main.hs | bsd-3-clause | 622 | 0 | 10 | 108 | 92 | 49 | 43 | 12 | 1 |
-- |
-- Module: Data.Float.BinString
-- License: BSD-style
-- Maintainer: me@lelf.lu
--
--
-- This module contains functions for formatting and parsing floating point
-- values as C99 printf/scanf functions with format string @%a@ do.
--
-- The format is [-]0x/h.hhhhh/p±/ddd/, where /h.hhhhh/ is significand
... | llelf/float-binstring | Data/Float/BinString.hs | bsd-3-clause | 4,694 | 0 | 15 | 1,320 | 1,196 | 634 | 562 | 76 | 2 |
{-# LANGUAGE CPP, BangPatterns #-}
{-#LANGUAGE RankNTypes, OverloadedStrings, ScopedTypeVariables #-}
-- | This library emulates "Data.ByteString.Lazy.Char8" but includes a monadic element
-- and thus at certain points uses a `Stream`/`FreeT` type in place of lists.
-- See the documentation for @Data.ByteString.Str... | michaelt/streaming-bytestring | Data/ByteString/Streaming/Char8.hs | bsd-3-clause | 25,121 | 0 | 25 | 6,699 | 5,038 | 2,736 | 2,302 | 350 | 8 |
{-# LANGUAGE ScopedTypeVariables #-}
-- | Utilities for interleaving transition operators and running Markov chains.
module Math.Probably.MCMC (
-- * Strategies
module Strategy
-- * Interleaving
, interleave
, polyInterleave
, frequency
, oneOfRandomly
-- * Other
, ezMC
, trace
) where
import... | glutamate/probably-baysig | src/Math/Probably/MCMC.hs | bsd-3-clause | 2,457 | 0 | 13 | 511 | 650 | 349 | 301 | 46 | 2 |
{-# LANGUAGE MultiParamTypeClasses
, FlexibleInstances
, ViewPatterns
, TupleSections
#-}
module Spire.Canonical.Evaluator
(lookupValAndType , lookupType , sub , sub2 , elim , app , app2)
where
import Unbound.LocallyNameless hiding ( Spine )
import Spire.Canonical.Types
im... | spire/spire | src/Spire/Canonical/Evaluator.hs | bsd-3-clause | 8,446 | 0 | 14 | 2,149 | 3,735 | 1,886 | 1,849 | 198 | 2 |
{-# LANGUAGE FlexibleContexts
#-}
module OpSem where
import AST
import Errors
import qualified Control.Monad.Except as M
import qualified Control.Monad.IO.Class as M
-- (Recursion magic happens here)
import qualified Data.Functor.Foldable as Rec
import qualified Data.Map.Strict as Map
import Data.Map.Strict (Map)
i... | ClathomasPrime/ImpCore | Impcore/src/OpSem.hs | bsd-3-clause | 4,185 | 0 | 17 | 1,247 | 1,667 | 833 | 834 | 102 | 7 |
-- |
-- Module : Network.TLS.Types
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
module Network.TLS.Types
( Version(..)
, SessionID
, SessionData(..)
, CipherID
, CompressionID
, Role(..)
, inver... | erikd/hs-tls | core/Network/TLS/Types.hs | bsd-3-clause | 1,296 | 0 | 9 | 292 | 262 | 166 | 96 | 30 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GADTs #-}
module Network.Krist.Transaction
where
import Data.Aeson
import GHC.Generics
import Data.Monoid
import Control.Krist.Request
import Control.Monad
import Control.Monad.IO.Class
import Syst... | demhydraz/krisths | src/Network/Krist/Transaction.hs | bsd-3-clause | 4,115 | 0 | 19 | 1,215 | 1,181 | 618 | 563 | 86 | 1 |
{-# LANGUAGE MagicHash #-}
module Main where
import GHC.Exts ( Float(F#),
eqFloat#, neFloat#, ltFloat#,
leFloat#, gtFloat#, geFloat#
)
fcmp_eq, fcmp_ne, fcmp_lt, fcmp_le, fcmp_gt, fcmp_ge :: (String, Float -> Float -> Bool)
fcmp_eq = ("==", \ (F# a) (F# b) -> a `eqFloat#` b)
fcmp_ne = ("/=", \ (F# a)... | kfish/const-math-ghc-plugin | tests/ghc-7.6/arith016.hs | bsd-3-clause | 982 | 6 | 12 | 246 | 457 | 265 | 192 | 23 | 1 |
{- Test Show instances
Copyright (c) 2014 Richard Eisenberg
-}
module Tests.Show where
import Data.Metrology
import Data.Metrology.Show ()
import Data.Metrology.SI
import Test.Tasty
import Test.Tasty.HUnit
five :: Double
five = 5
tests :: TestTree
tests = testGroup "Show"
[ testCase "Meter" $ show (five % Met... | goldfirere/units | units-test/Tests/Show.hs | bsd-3-clause | 649 | 0 | 15 | 125 | 212 | 115 | 97 | 15 | 1 |
{-|
Module : Idris.Parser
Description : Idris' parser.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE ConstraintKinds, FlexibleContexts, GeneralizedNewtypeDeriving,
PatternGuards #-}
{-# OPTIONS_GHC -O0 #-}
module Idris.Parser(module Idris.Parser,
... | Heather/Idris-dev | src/Idris/Parser.hs | bsd-3-clause | 73,853 | 561 | 26 | 30,496 | 15,918 | 8,532 | 7,386 | 1,275 | 27 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "Network/Sendfile/Types.hs" #-}
module Network.Sendfile.Types where
-- |
-- File range for 'sendfile'.
data FileRange = EntireFile
| PartOfFile {
rangeOffset :: Integer
, rangeLength :: Integer
}
| phischu/fragnix | tests/packages/scotty/Network.Sendfile.Types.hs | bsd-3-clause | 307 | 0 | 8 | 105 | 35 | 24 | 11 | 7 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Rede.SimpleHTTP1Response(exampleHTTP11Response, exampleHTTP20Response, shortResponse) where
import qualified Data.ByteString as B
-- Just to check what a browser thinks about this port
exampleHTTP11Response :: B.ByteString
exampleHTTP11Response = "HTTP/1.1 200 OK\r\n\
\C... | alcidesv/ReH | hs-src/Rede/SimpleHTTP1Response.hs | bsd-3-clause | 9,171 | 0 | 5 | 1,211 | 63 | 40 | 23 | 9 | 1 |
-- |
-- Module : Network.SimpleIRC
-- Copyright : (c) Dominik Picheta 2010
-- License : BSD3
--
-- Maintainer : morfeusz8@gmail.com
-- Stability : Alpha
-- Portability : portable
--
-- Simple and efficient IRC Library
--
module Network.SimpleIRC (
-- * Core
module Network.SimpleIRC.Core
-- * Messages
, m... | edwtjo/SimpleIRC | Network/SimpleIRC.hs | bsd-3-clause | 430 | 0 | 5 | 78 | 47 | 36 | 11 | 5 | 0 |
<?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="ru-RU">
<title>>Запуск приложений | ZAP-расширения </title>
<maps>
<homeID>top</homeID>
... | thc202/zap-extensions | addOns/invoke/src/main/javahelp/org/zaproxy/zap/extension/invoke/resources/help_ru_RU/helpset_ru_RU.hs | apache-2.0 | 1,042 | 76 | 55 | 159 | 523 | 261 | 262 | -1 | -1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Create new a new project directory populated with a basic working
-- project.
module Stack.New
( new
... | Fuuzetsu/stack | src/Stack/New.hs | bsd-3-clause | 17,703 | 0 | 23 | 5,484 | 4,041 | 2,046 | 1,995 | 404 | 5 |
{-# LANGUAGE PolyKinds, GADTs #-}
module T17541b where
import Data.Kind
data T k :: k -> Type where
MkT1 :: T Type Int
MkT2 :: T (Type -> Type) Maybe
| sdiehl/ghc | testsuite/tests/dependent/should_fail/T17541b.hs | bsd-3-clause | 161 | 0 | 8 | 41 | 49 | 29 | 20 | -1 | -1 |
{-# LANGUAGE UndecidableInstances #-}
module LargeNumberTest where
import Data.Word
import Init
share [mkPersist sqlSettings { mpsGeneric = True }, mkMigrate "numberMigrate"] [persistLowerCase|
Number
intx Int
int32 Int32
word32 Word32
int64 Int64
word64 Word64
deriving Show Eq
|]
cleanDB... | yesodweb/persistent | persistent-test/src/LargeNumberTest.hs | mit | 1,070 | 0 | 17 | 336 | 377 | 177 | 200 | -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="sq-AL">
<title>Directory List v2.3 LC</title>
<maps>
<homeID>directorylistv2_3_lc</homeID>
... | kingthorin/zap-extensions | addOns/directorylistv2_3_lc/src/main/javahelp/help_sq_AL/helpset_sq_AL.hs | apache-2.0 | 984 | 83 | 52 | 158 | 397 | 210 | 187 | -1 | -1 |
module SubSubPatternIn1 where
f :: [Int] -> Int
f ((x : (y : ys)))
= case ys of
ys@[] -> x + y
ys@(b_1 : b_2) -> x + y
f ((x : (y : ys))) = x + y
| kmate/HaRe | old/testing/introCase/SubSubPatternIn1AST.hs | bsd-3-clause | 179 | 0 | 10 | 73 | 109 | 61 | 48 | 7 | 2 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings, TupleSections, ViewPatterns #-}
import Yesod.Routes.TH
import Yesod.Routes.Parse
import THHelper
import Language.Haskell.TH.Syntax
import Criterion.Main
import Data.Text (words)
import Prelude hiding (words)
import Control.DeepSeq
import Yesod.Routes.TH.Simp... | ygale/yesod | yesod-core/bench/th.hs | mit | 1,836 | 0 | 15 | 456 | 668 | 349 | 319 | 55 | 1 |
module Helper (
module Test.Hspec
, module Control.Applicative
, module Test.Mockery.Directory
) where
import Test.Hspec
import Test.Mockery.Directory
import Control.Applicative
| sol/reserve | test/Helper.hs | mit | 211 | 0 | 5 | 52 | 41 | 27 | 14 | 7 | 0 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.HTMLMapElement (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.HTMLMapElement
#else
module Graphics.UI.Gtk.WebKit.DOM.HTMLMapElement
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI))... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/HTMLMapElement.hs | mit | 455 | 0 | 5 | 39 | 33 | 26 | 7 | 4 | 0 |
module Y2016.M07.D27.Solution where
import Control.Arrow ((&&&))
import Control.Monad (liftM2)
import Data.List (group, sort)
import Data.Maybe (fromJust)
import Data.Set (Set)
import qualified Data.Set as Set
import Y2016.M07.D19.Solution (figure2)
import Y2016.M07.D20.Solution (FigureC, lineSegments)
import Y2016.M... | geophf/1HaskellADay | exercises/HAD/Y2016/M07/D27/Solution.hs | mit | 3,406 | 0 | 21 | 598 | 651 | 366 | 285 | 31 | 2 |
module Control.Foldl.Extended where
import Control.Foldl (Fold(..))
import qualified Control.Foldl as L
import qualified Data.Map as Map hiding (foldr)
-- | turn a regular fold into a Map.Map fold
keyFold :: (Ord c) => Fold a b -> Fold (c, a) [(c, b)]
keyFold (Fold step begin done) = Fold step' begin' done'... | tonyday567/foldl-extended | src/Control/Foldl/Extended.hs | mit | 2,620 | 0 | 12 | 740 | 1,189 | 630 | 559 | 59 | 2 |
module Monoid1 where
import Data.Semigroup
import Test.QuickCheck
import SemiGroupAssociativeLaw
import MonoidLaws
data Trivial = Trivial deriving (Eq, Show)
instance Semigroup Trivial where
_ <> _ = Trivial
instance Monoid Trivial where
mempty = Trivial
mappend = (<>)
instance Arbitrary Trivial ... | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/Monoid1.hs | mit | 595 | 0 | 9 | 114 | 170 | 92 | 78 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Match
import qualified Data.ByteString as B
import qualified Data.ByteString.UTF8 as UB
import Data.String.Utils (strip)
import Safe
import System.IO (stdin)
import Control.Applicative
main :: IO ()
main = do
content <- r... | sdroege/snippets.hs | html2.hs | mit | 950 | 8 | 12 | 243 | 259 | 134 | 125 | 24 | 2 |
module Core.Annotation where
import qualified Data.Generics.Fixplate as Fix
import Data.Set (Set)
data Annotation typeId = Annotation
{ freeVars :: Set typeId
}
deriving (Eq, Ord, Show)
type Annotated f id = Fix.Attr (f id) (Annotation id)
| fredun/compiler | src/Core/Annotation.hs | mit | 252 | 0 | 9 | 48 | 86 | 51 | 35 | 7 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Monad (
Monad(..)
, MonadPlus(..)
, (=<<)
, (>=>)
, (<=<)
, forever
, join
, mfilter
, filterM
, mapAndUnzipM
, zipWithM
, zipWithM_
, foldM
, foldM_
, replicateM
, replicateM_
, concatMapM
, g... | ardfard/protolude | src/Monad.hs | mit | 1,066 | 0 | 10 | 304 | 431 | 245 | 186 | 54 | 1 |
{-# htermination delete :: (Eq a, Eq k) => (Either a k) -> [(Either a k)] -> [(Either a k)] #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_delete_11.hs | mit | 108 | 0 | 3 | 23 | 5 | 3 | 2 | 1 | 0 |
{-# LANGUAGE BangPatterns, OverloadedStrings #-}
module Network.Wai.Handler.Warp.Buffer (
bufferSize
, allocateBuffer
, freeBuffer
, mallocBS
, newBufferPool
, withBufferPool
, toBlazeBuffer
, copy
, bufferIO
) where
import qualified Data.ByteString as BS
import Data.ByteString.Internal (ByteStr... | mfine/wai | warp/Network/Wai/Handler/Warp/Buffer.hs | mit | 3,222 | 0 | 11 | 557 | 823 | 445 | 378 | 72 | 2 |
{-# LANGUAGE TemplateHaskell #-}
-- | Tinkering in a scratch buffer
module Scratch where
import Control.Lens
import Control.Monad.Reader
doSthg :: Monad m => (a -> r) -> m a -> m r
doSthg f mv = mv >>= \x -> return $ f x
-- doSthg (1+) (Just 10)
-- > Just 11
-- doSthg (1+) Nothing
-- > Nothing
... | ardumont/haskell-lab | src/Scratch.hs | gpl-2.0 | 7,502 | 0 | 14 | 1,878 | 1,720 | 934 | 786 | -1 | -1 |
module BaseParser where
import Control.Applicative hiding (many)
import Control.Arrow
import Control.Monad
newtype Parser a = Parser { runParser :: String -> [(a,String)] }
instance Functor Parser where
fmap f p = Parser $ \ s -> map (first f) (runParser p s)
instance Applicative Parser where
pure x = Parse... | xkollar/handy-haskell | irc/BaseParser.hs | gpl-3.0 | 2,446 | 0 | 12 | 674 | 1,322 | 683 | 639 | 70 | 3 |
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses,
TemplateHaskell, OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts, TupleSections #-}
module WJR.Application
where
import WJR.Imports
import Yesod.Static (Static, Route(..), static)
import Text.Hamlet (hamletFile,shamlet)
import qualif... | drpowell/Prokka-web | WJR/Application.hs | gpl-3.0 | 13,710 | 0 | 20 | 3,994 | 3,400 | 1,683 | 1,717 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-|
Module : Data.Valet.Utils.Reader
Description : Generic class for the "reader".
Copyright : (c) Leonard Monnier, 2015
License : GPL-3
Maintainer : l... | momomimachli/Valet | src/Data/Valet/Utils/Reader.hs | gpl-3.0 | 1,278 | 0 | 7 | 262 | 111 | 65 | 46 | 14 | 0 |
module Main where
import System.Environment(getArgs)
import Control.Monad
ageStatus :: Integer -> String
ageStatus x
| 0 <= x && x <= 2 = "Home"
| 3 <= x && x <= 4 = "Preschool"
| 5 <= x && x <= 11 = "Elementary school"
| 12 <= x && x <= 14 = "Middle school"
| 15 <= x ... | cryptica/CodeEval | Challenges/152_AgeDistribution/main.hs | gpl-3.0 | 702 | 0 | 10 | 232 | 273 | 135 | 138 | 18 | 1 |
{- `s` stands for `suspension functor` -}
import Control.Monad.Trans
newtype Coroutine s m r = Coroutine { resume :: m (CoroutineState s m r) }
data CoroutineState s m r = Run (s (Coroutine s m r))
| Done r
instance (Functor s, Monad m) => Functor (Coroutine s m) where
fmap f co... | KenetJervet/mapensee | haskell/coroutine/02Coroutine.hs | gpl-3.0 | 993 | 0 | 18 | 290 | 434 | 217 | 217 | 24 | 0 |
{-# LANGUAGE TemplateHaskell, StandaloneDeriving #-}
module Framework where
-- * Imports
-------------------------------------------------------------------
import Control.Applicative
import Control.Lens
import Control.Monad
import Data.Foldable (foldMap, traverse_)
import System.FilePath ((</>))
import Data.IORef
... | fatho/spacemonads | src/Framework.hs | gpl-3.0 | 4,074 | 0 | 18 | 830 | 1,146 | 576 | 570 | 83 | 1 |
runCont :: Cont r a -> (a -> r) -> r
runCont (Cont k) h = k h | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/haskell/snippet24.hs | gpl-3.0 | 61 | 0 | 8 | 17 | 45 | 22 | 23 | 2 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-discovery/gen/Network/Google/Resource/Discovery/APIs/GetRest.hs | mpl-2.0 | 2,876 | 0 | 14 | 690 | 380 | 228 | 152 | 59 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.SecurityCenter.Types
-- Copyright : (c) 2015-2016 Bren... | brendanhay/gogol | gogol-securitycenter/gen/Network/Google/SecurityCenter/Types.hs | mpl-2.0 | 11,832 | 0 | 7 | 2,570 | 1,107 | 769 | 338 | 315 | 1 |
-- This file is part of purebred
-- Copyright (C) 2017-2021 Róman Joost and Fraser Tweedale
--
-- purebred is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at yo... | purebred-mua/purebred | src/Purebred/UI/App.hs | agpl-3.0 | 10,825 | 0 | 18 | 1,899 | 2,385 | 1,266 | 1,119 | 176 | 25 |
module AlphabeticAnagrams where
import Data.List
import Data.Bits
import Control.Arrow
import Data.Maybe
alpha = ['A'..'Z']
type BIT = [Int]
mapString :: String -> [Int]
mapString = ((\x -> fromJust $ elemIndex x alpha) <$>)
lowbit :: Int -> Int
lowbit n = n .&. (-n)
bitSum :: [Int] -> Int -> Int
bitSum bit 0 = 0... | ice1000/OI-codes | codewars/201-300/alphabetic-anagrams.hs | agpl-3.0 | 1,103 | 0 | 14 | 305 | 472 | 262 | 210 | -1 | -1 |
{-# LANGUAGE CPP #-}
--
-- Copyright (C) 2004-5 Don Stewart - http://www.cse.unsw.edu.au/~dons
--
-- 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, ... | facundominguez/package-loader | src/System/Loader/Package/Env.hs | lgpl-2.1 | 18,508 | 0 | 23 | 5,084 | 3,780 | 2,043 | 1,737 | 209 | 9 |
{-
- This file is part of Bilder.
-
- Bilder 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 3 of the License, or
- (at your option) any later version.
-
- Bilder i... | ingemaradahl/bilder | src/Compiler/Simple/Types.hs | lgpl-3.0 | 1,176 | 0 | 10 | 251 | 89 | 54 | 35 | 10 | 0 |
{-# OPTIONS_GHC -Wall -XFlexibleInstances #-}
{-
-
- Copyright 2014 -- name removed for blind review, all rights reserved! Please push a git request to receive author's name! --
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You... | DatePaper616/code | eMOD.hs | apache-2.0 | 2,447 | 0 | 18 | 635 | 605 | 299 | 306 | 40 | 5 |
unit = ["", "Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"]
toStr 0 _ = []
toStr _ [] = []
toStr n (u:us) =
let m = n `mod` 10000
n'= n `div` 10000
in
if m == 0
then (toStr n' us)
else (toStr n' us) ++ show(m) ++ u
ans' :: Integer -> Integer... | a143753/AOJ | 0287.hs | apache-2.0 | 595 | 0 | 14 | 159 | 365 | 198 | 167 | 22 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.