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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module Zero.KeyFetchToken.Relations
(
defineKeyFetchTokenRelation
, keyFetchStatesFromRelation
, keyFetchTokensFromRelation
, keyFetchTokenAttributes
) where
import qualified Data.Vector as V
import Zero.Persistence
import Zero.KeyFetchToken.Internal
import Zero.Token.Inter... | et4te/zero | server/src/Zero/KeyFetchToken/Relations.hs | bsd-3-clause | 2,849 | 0 | 13 | 497 | 734 | 376 | 358 | 70 | 2 |
-- Samples of graphs useful for testing
-- Many examples come from organic chemistry. These were generated
-- from SMILES strings using a smiles parser which generates
-- LGraphs
module Data.Graph.Graphs (
methane, ethane, propane, butane, alkane
, isobutane, isopentane, neopentane
, cycloalkane, cyclopropa... | stefan-hoeck/labeled-graph | Data/Graph/Graphs.hs | bsd-3-clause | 6,901 | 0 | 10 | 1,514 | 4,320 | 2,483 | 1,837 | -1 | -1 |
module Type (
typeOf
) where
import Context
import Base
typeOf :: Term -> TermType
typeOf t = go makeEmptyContext t
go :: Context -> Term -> TermType
{- T-True -}
go _ TermTrue = TypeBool
{- T-False -}
go _ TermFalse = TypeBool
{- T-If -}
go ctx (TermIfThenElse t t1 t2) = case go ctx t of
TypeBool -> if ty1 =... | foreverbell/unlimited-plt-toys | tapl/simplebool/Type.hs | bsd-3-clause | 970 | 0 | 9 | 265 | 312 | 160 | 152 | 25 | 5 |
{-# LANGUAGE OverloadedStrings, CPP #-}
module RoundTripSpec where
import Control.Monad (replicateM)
import Data.IP (IP (..), IPv4, IPv6, toIPv4, toIPv6)
import qualified Data.ByteString.Char8 as BS
import Network.DNS.Internal
import Network.DNS.Decode
import Network.DNS.Encode
import Test.Hspec
import Test.Hspec.Qui... | greydot/dns | test/RoundTripSpec.hs | bsd-3-clause | 5,178 | 0 | 14 | 1,258 | 1,666 | 865 | 801 | 126 | 13 |
{-# LANGUAGE OverloadedStrings #-}
module Network.XMPP.Auth where
import Network.XMPP.XMLParse
import Network.XMPP.XMPPMonad
import Network.XMPP.Stanzas
import Data.Text (Text)
-- |Non-SASL authentication, following XEP-0078.
startAuth :: Text -- ^Username (part before \@ in JID)
-> Text ... | drpowell/XMPP | Network/XMPP/Auth.hs | bsd-3-clause | 1,862 | 0 | 19 | 844 | 268 | 144 | 124 | 29 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.JavaScript.SpiderMonkey.Parser where
import Data.Aeson
import Data.Aeson.Types
import Data.Aeson.TH
import Data.Int
import Control.Applicative
import Data.Monoid()
import Control.Monad
import Data.... | jswebtools/mozilla-js-parser-api | src/Language/JavaScript/SpiderMonkey/Parser.hs | bsd-3-clause | 17,968 | 103 | 20 | 5,499 | 4,476 | 2,477 | 1,999 | 304 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module Test.Pos.Util.Tripping where
import qualified Prelude
import Universum
import Data.Aeson (FromJSON, ToJSON, eitherDecode, encode)
import Data.Text.Internal.Builder (fromText, toLazyText)
import ... | input-output-hk/pos-haskell-prototype | util/test/Test/Pos/Util/Tripping.hs | mit | 5,502 | 0 | 16 | 1,646 | 1,521 | 794 | 727 | -1 | -1 |
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
{-|
Core Noun Implementation
Each cell has a pre-calculated hash and a `size` field. The size is
the total number of nodes under the tree of the cell. This is used
as a heuristic to choose a hash-table si... | jfranklin9000/urbit | pkg/hs/urbit-king/lib/Urbit/Noun/Core.hs | mit | 4,789 | 0 | 20 | 1,521 | 1,494 | 787 | 707 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
-- | Part of GState DB which stores data necessary for update system.
module Pos.DB.Update.GState
(
-- * Getters
getAdoptedBV
, getAdoptedBVData
, getAdoptedBVFull
, getBVState
, getConsensusEra
... | input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Update/GState.hs | mit | 13,678 | 0 | 14 | 2,747 | 2,632 | 1,441 | 1,191 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
-- | Auxx plugin.
module Plugin
( auxxPlugin
, rawExec
) where
import Universum
#if !(defined(mingw32_HOST_OS))
import System.Exit (ExitCode (ExitSuccess))
import Sys... | input-output-hk/pos-haskell-prototype | auxx/src/Plugin.hs | mit | 6,746 | 0 | 14 | 1,809 | 1,455 | 739 | 716 | -1 | -1 |
-- We need 'FlexibleInstances to instance 'ArgVal' for 'Maybe Exp' and
-- '( String, Exp )'.
{-# LANGUAGE FlexibleInstances #-}
module Arith where
import Prelude hiding ( exp )
import System.Console.CmdTheLine hiding ( eval )
import Control.Applicative hiding ( (<|>) )
import Control.Monad ( guard )
import Data... | glutamate/cmdtheline | test/Arith.hs | mit | 4,544 | 0 | 16 | 1,266 | 1,665 | 872 | 793 | 122 | 5 |
---------------------------------------------------------------------------------
--
-- https://github.storm.gatech.edu/NetASM
--
-- File:
-- Passthrough/Code.hs
--
-- Project:
-- NetASM: A Network Assembly for Orchestrating Programmable Network Devices
--
-- Author:
-- Muhammad Shahbaz
--
-- ... | 8l/NetASM-haskell | Apps/Passthrough/Code.hs | gpl-3.0 | 2,644 | 0 | 10 | 684 | 303 | 202 | 101 | 20 | 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="zh-CN">
<title>Authentication Statistics | ZAP Extension</title>
<maps>
<homeID>top</homeID... | veggiespam/zap-extensions | addOns/authstats/src/main/javahelp/org/zaproxy/zap/extension/authstats/resources/help_zh_CN/helpset_zh_CN.hs | apache-2.0 | 987 | 80 | 66 | 160 | 415 | 210 | 205 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
-- | Test suite for Stack.Dot
module Stack.DotSpec where
import Control.Monad (filterM)
import Data.Foldable as F
import Data.Functor.Identity
import Data.List ((\\))
import qualified Data.Map... | AndrewRademacher/stack | src/test/Stack/DotSpec.hs | bsd-3-clause | 5,515 | 0 | 24 | 1,267 | 1,562 | 841 | 721 | 101 | 30 |
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import System.Exit (ExitCode(..), exitWith)
import Prime (nth)
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess
testCase :: String ->... | pminten/xhaskell | nth-prime/nth-prime_test.hs | mit | 751 | 0 | 12 | 154 | 347 | 192 | 155 | 22 | 2 |
-- | This module does some string manipulation based on natural languages
module Database.Design.Ampersand.Misc.Languages
( Lang(English,Dutch)
, allLangs
, plural
) where
import Data.Char (toLower)
import Data.List (isSuffixOf)
import Database.Design.Ampersand.Core.Pa... | guoy34/ampersand | src/Database/Design/Ampersand/Misc/Languages.hs | gpl-3.0 | 2,296 | 0 | 15 | 667 | 838 | 458 | 380 | 47 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{- |
Module : Network.MPD.Commands.PlaybackOptions
Copyright : (c) Ben Sinclair 2005-2009, Joachim Fasting 2012
License : MIT (see LICENSE)
Maintainer : joachifm@fastmail.fm
Stability : stable
Portability : unportable
Playback options.
-}
module Network.MPD.Commands.... | bens/libmpd-haskell | src/Network/MPD/Commands/PlaybackOptions.hs | lgpl-2.1 | 1,589 | 0 | 8 | 321 | 360 | 202 | 158 | 31 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Db
-- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : po... | DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Program/Db.hs | bsd-3-clause | 17,834 | 0 | 19 | 4,173 | 2,935 | 1,616 | 1,319 | 260 | 4 |
<?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="id-ID">
<title>DOM XSS Aktif Memindai Aturan | ZAP Ekstensi</title>
<maps>
<homeID>top</home... | kingthorin/zap-extensions | addOns/domxss/src/main/javahelp/org/zaproxy/zap/extension/domxss/resources/help_id_ID/helpset_id_ID.hs | apache-2.0 | 986 | 78 | 66 | 162 | 419 | 212 | 207 | -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="sr-CS">
<title>Requester</title>
<maps>
<homeID>requester</homeID>
<mapref location="ma... | thc202/zap-extensions | addOns/requester/src/main/javahelp/help_sr_CS/helpset_sr_CS.hs | apache-2.0 | 960 | 77 | 66 | 155 | 404 | 205 | 199 | -1 | -1 |
module SubstituteBaseStruct where
import Substitute
import Recursive
import HasBaseStruct
import BaseSyntax
substE = substE' r
substE' r s e0 =
case mapEI id (subst s) id (esubst s) id id e0 of
HsId (HsVar x) -> s x
HsInfixApp e1 (HsVar x) e2 -> s x `hsApp` e1 `hsApp` e2
HsLeftSection e (HsVar x... | forste/haReFork | tools/base/transforms/SubstituteBaseStruct.hs | bsd-3-clause | 877 | 0 | 10 | 219 | 404 | 201 | 203 | -1 | -1 |
import Map
import MapAsSet
main = do
let x = insert 0 "foo"
. delete 1
. insert 1 undefined
. insert (6 :: Int) "foo"
$ empty
print (member 1 x)
print (keysSet x)
print (toList x)
print x
| ghc-android/ghc | testsuite/tests/driver/sigof02/Double.hs | bsd-3-clause | 249 | 0 | 14 | 101 | 105 | 48 | 57 | 12 | 1 |
{- arch-tag: Tests for GZip module
Copyright (C) 2004-2011 John Goerzen <jgoerzen@complete.org>
All rights reserved.
For license and copyright information, see the file LICENSE
-}
module GZiptest(tests) where
import Test.HUnit
import System.FileArchive.GZip
import System.FilePath
import Data.Compression.Inflate
impo... | haskellbr/missingh | missingh-all/testsrc/GZiptest.hs | mit | 2,896 | 0 | 13 | 1,023 | 503 | 280 | 223 | 40 | 1 |
module Sandbox (tryProblem) where
import Problems (problems, Problem(..), Test)
import System.Process
import System.Timeout
import System.IO
import Control.Monad (void)
import Control.Concurrent.Async
import Data.Unique
import System.Directory
import Data.List
import Data.Aeson hiding (json)
import Data.Text (pack)
d... | bramgg/99haskell | Sandbox.hs | mit | 3,624 | 0 | 14 | 1,299 | 1,160 | 584 | 576 | 83 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE Strict #-}
module SmallGL.SelectorObject
( SelectorObject (..)
, initSelectorObject
, releaseSelectorObjectRes
, updateSelectorSizeIfNeeded
) where
import Numeric.DataFrame.IO
import Unsafe.Co... | achirkin/qua-view | src/SmallGL/SelectorObject.hs | mit | 2,480 | 0 | 13 | 443 | 627 | 309 | 318 | 67 | 1 |
import Control.Monad
main = print (perms [0..9] !! 999999)
others _ [] = []
others xs (y:zs) = (y, xs ++ zs) : others (xs ++ [y]) zs
perms [] = [[]]
perms list = do
(x, yz) <- others [] list
zy <- perms yz
return (x : zy)
-- perms :: [a] -> [a] -> [[a]]
-- perms [] [] = [[]]
-- perms xs [y] = liftM (y:)... | nickspinale/euler | complete/024.hs | mit | 402 | 0 | 9 | 106 | 159 | 83 | 76 | 9 | 1 |
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, OverlappingInstances #-}
module Path where
import Data.List
import ListUtil
type Path = String
class Pathy a where
pathOf :: a -> Path
instance Pathy Path where
pathOf path = path
samePath :: Pathy a => Pathy b => a -> b -> Bool
samePath a b = ... | raimohanska/oegysync | Path.hs | mit | 1,182 | 0 | 10 | 249 | 482 | 244 | 238 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
import qualified SDL
import Control.Concurrent (threadDelay)
import Linear (V2(..), V4(..))
import Linear.Affine (Point(P))
import Control.Monad (unless)
import Foreign.C.Types
import Data.Foldable (traverse_)
import System.IO (hPutStrLn, stderr)
main :: IO ()
main = do
SDL.init... | nitrix/lasers | src/Main.hs | mit | 2,783 | 0 | 19 | 756 | 989 | 488 | 501 | 61 | 2 |
-- | The recommended process for exporting plugins is to create a new module
-- that exports a single function currying the first three arguments to
-- 'Plugin'. The remaining argument, the Slack secret token, can be
-- supplied in a separate file exporting the list of installed commands for
-- Haskbot. This en... | Jonplussed/haskbot-core | src/Haskbot/Plugin.hs | mit | 3,764 | 0 | 11 | 756 | 461 | 274 | 187 | 37 | 2 |
module Unison.Util.TQueue where
import Unison.Prelude
import UnliftIO.STM hiding (TQueue)
import qualified Control.Concurrent.Async as Async
import qualified Data.Sequence as S
import Data.Sequence (Seq((:<|)), (|>))
data TQueue a = TQueue (TVar (Seq a)) (TVar Word64)
newIO :: MonadIO m => m (TQueue a)
newIO = TQu... | unisonweb/platform | parser-typechecker/src/Unison/Util/TQueue.hs | mit | 2,669 | 0 | 12 | 591 | 1,134 | 565 | 569 | -1 | -1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Crypto
(getRandomValues, getRandomValues_, getSubtle, getWebkitSubtle,
Crypto(..), gTypeCrypto)
wh... | ghcjs/jsaddle-dom | src/JSDOM/Generated/Crypto.hs | mit | 2,276 | 0 | 12 | 322 | 545 | 328 | 217 | 36 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.ScriptProfileNode
(js_children, children, js_getId, getId, js_getFunctionName,
getFunctionName, js_getUrl, getUrl, js_getLineNumber,
getLineNumber, js_getColumnNumber, getColumnNumber,
... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/ScriptProfileNode.hs | mit | 3,610 | 36 | 11 | 473 | 784 | 450 | 334 | 54 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-targetgroupinfo.html
module Stratosphere.ResourceProperties.CodeDeployDeploymentGr... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/CodeDeployDeploymentGroupTargetGroupInfo.hs | mit | 1,707 | 0 | 12 | 158 | 174 | 101 | 73 | 22 | 1 |
{-# LANGUAGE ExistentialQuantification #-}
module Light.Camera
( Camera(..), CameraBox, cameraBox
)
where
import Light.Film
import Light.Geometry
class Camera a where
cameraTransform :: a -> Transform
cameraFilm :: a -> Film
cameraRay :: a -> (Double, Double) -> Ray
data CameraBox = forall c. (... | jtdubs/Light | src/Light/Camera.hs | mit | 786 | 0 | 9 | 151 | 267 | 141 | 126 | 20 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html
module Stratosphere.ResourceProperties.CodeBuildProjectProjectCache where... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/CodeBuildProjectProjectCache.hs | mit | 2,531 | 0 | 13 | 260 | 356 | 202 | 154 | 33 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE CPP #-}
module Hpack.Run (
run
, renderPackage
, RenderSettings(..)
, Alignment(..)
, CommaStyle(..)
, defaultRenderSettings
#ifdef TEST
, renderConditional
, renderFlag
, render... | yamadapc/hpack-convert | src/Hpack/Run.hs | mit | 9,779 | 0 | 18 | 1,784 | 2,577 | 1,356 | 1,221 | 202 | 3 |
module CAH.Cards.Import where
import CAH.Cards.Types
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.ByteString.Lazy as BS
import Data.Aeson
import Data.Set (Set)
import qualified Data.Set as S
import Sys... | EXio4/ircah | src/CAH/Cards/Import.hs | mit | 1,430 | 0 | 14 | 504 | 518 | 277 | 241 | -1 | -1 |
import Data.List.Split
import Data.Char
import Control.Arrow
palindromeMoveCnt :: String -> Int
palindromeMoveCnt s = sum diffs
where [start, restM1] = (chunksOf $ (length s + 1) `div` 2) s
rest = if length s `mod` 2 /= 0 then last start : restM1 else restM1
f a b = abs $ ord b - ord a
diffs ... | Dobiasd/HackerRank-solutions | Algorithms/Warmup/The_Love-Letter_Mystery/Main.hs | mit | 460 | 0 | 13 | 114 | 199 | 103 | 96 | 13 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volumeattachment.html
module Stratosphere.Resources.EC2VolumeAttachment where
import Stratosphere.Re... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/EC2VolumeAttachment.hs | mit | 2,521 | 0 | 15 | 317 | 370 | 211 | 159 | 37 | 1 |
{-| Path-related helper functions.
-}
{-
Copyright (C) 2012, 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version... | ribag/ganeti-experiments | src/Ganeti/Path.hs | gpl-2.0 | 5,037 | 0 | 8 | 861 | 725 | 413 | 312 | 89 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -fno-warn-implicit-prelude #-}
module Paths_wyah (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import Foreign
import Forei... | Mortomes/wyah | dist/build/autogen/Paths_wyah.hs | gpl-3.0 | 3,351 | 0 | 21 | 782 | 898 | 476 | 422 | 75 | 5 |
{-|
Module : Monads
Description : Photobooth Monads
Copyright : (c) Chris Tetreault, 2014
License : GPL-3
Stability : experimental
-}
module DMP.Photobooth.Monads where
import DMP.Photobooth.Module.Types
import DMP.Photobooth.Core.Types
import Control.Monad.State
import Control.Concurrent.STM
import Control.Monad.Tr... | christetreault/dmp-photo-booth-prime | DMP/Photobooth/Monads.hs | gpl-3.0 | 6,337 | 0 | 15 | 1,810 | 1,396 | 713 | 683 | 183 | 1 |
module TPL.Eval where
import Control.Applicative ((<$>), (<*>), (<|>))
import Control.Monad.Error (foldM, liftIO, runErrorT,
throwError)
import Data.IORef (newIORef)
import Data.List ... | TikhonJelvis/TPL | src/TPL/Eval.hs | gpl-3.0 | 7,139 | 0 | 16 | 2,564 | 2,419 | 1,201 | 1,218 | 111 | 20 |
{- |
Module : $Header$
Description : Module for elliptic curves over Z/NZ (hence modulus)
Copyright : (c) Michal Parusinski
License : GPLv3
Maintainer : mparusinski@gmail.com
Stability : experimental
Portability : portable
-}
module EllipticCurves.ModularEllipticCurves where
import Data.Either
... | mparusinski/Haskell-number-theory-library | EllipticCurves/ModularEllipticCurves.hs | gpl-3.0 | 4,641 | 0 | 18 | 1,553 | 1,640 | 886 | 754 | 71 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-adsense-host/gen/Network/Google/Resource/AdSenseHost/Reports/Generate.hs | mpl-2.0 | 6,317 | 0 | 20 | 1,596 | 1,055 | 610 | 445 | 141 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | olorin/amazonka | amazonka-iam/gen/Network/AWS/IAM/ListInstanceProfilesForRole.hs | mpl-2.0 | 8,027 | 0 | 14 | 1,603 | 995 | 591 | 404 | 116 | 1 |
{- Copyright 2014 David Farrell <shokku.ra@gmail.com>
- 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... | shockkolate/lambdircd | plugins.old/Whois.hs | apache-2.0 | 3,121 | 0 | 22 | 800 | 710 | 375 | 335 | 45 | 2 |
-- Copyright (c) 2013, Finn Espen Gundersen
-- All rights reserved
-- Licensed under the 2-clause Simplified BSD (FreeBSD) License
-- | Pure module for encoding and decoding Google Polyline format as specified in
-- https://developers.google.com/maps/documentation/utilities/polylinealgorithm
module GPolyline (en... | fegu/gpolyline | GPolyline.hs | bsd-2-clause | 5,497 | 1 | 12 | 1,164 | 1,647 | 898 | 749 | 95 | 1 |
{-| An implementation of the queue from
<http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Queues>.
The queue node will be automatically created and removed as necessary, and must
not be used for any other purposes. The parent node of the queue node must
already exist.
Queues may contain both n... | jnb/zookeeper | src/Zookeeper/Queue.hs | bsd-2-clause | 3,824 | 0 | 19 | 1,108 | 860 | 441 | 419 | 63 | 5 |
module C(C.bla) where
import D
bla :: Test
bla = undefined
| nominolo/haddock2 | examples/hide-bug/C.hs | bsd-2-clause | 62 | 0 | 5 | 14 | 24 | 15 | 9 | 4 | 1 |
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
module Bucket (
uploadObjectFromFile
, uploadObject
, deleteObject
, bucketExists
, createBucket
, deleteBucket
) where
import ... | lbodor/amazonia | src/Bucket.hs | bsd-3-clause | 1,974 | 0 | 15 | 529 | 598 | 300 | 298 | 51 | 1 |
module Core.Typecheck
( QName(..)
, QType
, QTyCon
, QTypes
, QExpr
, QMeta
, QPat
, Renamed
, typecheck
) where
import Control.Arrow (second)
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
... | abbradar/dnohs | src/Core/Typecheck.hs | bsd-3-clause | 16,102 | 0 | 26 | 5,022 | 6,767 | 3,358 | 3,409 | -1 | -1 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShaderSubroutine
-- Copyright : (c) Sven Panne 2014
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- ... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ShaderSubroutine.hs | bsd-3-clause | 3,916 | 0 | 15 | 348 | 579 | 339 | 240 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DefaultSignatures #-}
module Data.Var.Boxed
( MonadVar (..)
, contents
, modify
) where
import Control.Applicative
import Control.Lens
import qualified Control.Monad.ST.Lazy.Safe as Lazy
import Control.Monad.ST.Safe
import Cont... | sonyandy/wart-var | src/Data/Var/Boxed.hs | bsd-3-clause | 3,430 | 0 | 12 | 718 | 1,282 | 702 | 580 | 97 | 1 |
{-|
Module : Database.Taxi.Segment.Types
Description : Type definitions
Stability : Experimental
Maintainer : guha.rabishankar@gmail.com
-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards #-}
module Database.Taxi.Segment.Types where
import Control.Applicative ((<$>)... | rabisg/taxi | Database/Taxi/Segment/Types.hs | bsd-3-clause | 1,720 | 0 | 10 | 568 | 277 | 168 | 109 | 24 | 0 |
{-#LANGUAGE MonoLocalBinds #-}
module LambdaF2 where
import Name
import Value
import Lambda as Lam
import Data.Bifunctor
data LamTermF i j n a = LambdaF [(i, Name)] a
| ApplF a [a]
| VarF j n
| ValF j Value
| LetF j [Def i a] a
deriving (Eq, Show)
instance ... | kwibus/myLang | src/LambdaF2.hs | bsd-3-clause | 3,321 | 0 | 14 | 1,111 | 1,637 | 801 | 836 | 83 | 3 |
module LessWrong.COC.Error where
import Data.Text (unpack)
import LessWrong.COC.Type
import LessWrong.COC.Pretty
data CalculusError = ParsingError String
| UnknownVariable Var
| CannotEqualize Term Term
| InvalidType Term ... | zmactep/less-wrong | src/LessWrong/COC/Error.hs | bsd-3-clause | 702 | 0 | 10 | 217 | 187 | 98 | 89 | 13 | 0 |
module Minimax
where
import Debug.Trace
import Data.List
import Data.Ord
class GameState a where
evaluateState :: a -> Int
terminalState :: a -> Bool
genSuccessors :: a -> [Int]
makeSuccessor :: a -> Int -> a
isMaximizing :: a -> Bool
minimax :: (GameState a) => a -> Bool -> Int ... | tylerprete/haskell-minimax-games | src/minimax.hs | bsd-3-clause | 4,358 | 0 | 16 | 1,231 | 1,094 | 559 | 535 | 58 | 5 |
{-# OPTIONS_GHC -Wall #-}
module Main where
import Graphics.Gloss
import Physics.Learn.CarrotVec
import Physics.Learn.Position
import Physics.Learn.Curve
import Physics.Learn.Charge
import Physics.Learn.Visual.GlossTools
pixelsPerMeter :: Float
pixelsPerMeter = 40
pixelsPerVPM :: Float
pixelsPerVPM = 5.6
scalePoin... | walck/learn-physics | examples/src/eFieldLine2D.hs | bsd-3-clause | 1,252 | 0 | 13 | 247 | 531 | 293 | 238 | 32 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Evaluate(normalise) where
import Debug.Trace
import Core
normalise :: Context -> TT Name -> TT Name
normalise ctxt t = quote 0 (eval ctxt (hoas [] t))
-- We just evaluate HOAS terms. Any de Bruijn indices will refer to higher
-- level things, so, if w... | jxwr/hdep | src/Evaluate.hs | bsd-3-clause | 2,525 | 0 | 15 | 764 | 1,437 | 716 | 721 | 56 | 13 |
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
{-
A large and somewhat miscellaneous collection of utility functions used
throughout the rest of libfaction and in other tools that use it, like
@faction@. It has a very simple set of logging actions. It has low level
functions for running programs, a bunch of wrappers fo... | IreneKnapp/Faction | libfaction/Distribution/Simple/Utils.hs | bsd-3-clause | 40,229 | 0 | 19 | 10,713 | 8,462 | 4,413 | 4,049 | 648 | 7 |
{-# LANGUAGE TypeOperators, TupleSections #-}
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : Data.StateTrie
-- Copyright : (c) Conal Elliott 2012
-- License : BSD3
--
-- Maintain... | conal/state-trie | src/Data/StateTrie.hs | bsd-3-clause | 3,506 | 0 | 12 | 725 | 917 | 502 | 415 | 50 | 1 |
module Test.OCanrenize where
import OCanrenize
import Test.Helper (test)
import Syntax
unit_OCanrenizeTerm = do
test ocanren (C "fst" [] :: Term X) "(fst_ ())"
test ocanren (C "snd" [] :: Term X) "(snd_ ())"
test ocanren (C "fill" [] :: Term X) "(fill ())" | kajigor/uKanren_transformations | test/auto/Test/OCanrenize.hs | bsd-3-clause | 270 | 0 | 10 | 56 | 105 | 53 | 52 | 8 | 1 |
-----------------------------------------------------------------------------
--
-- The register liveness determinator
--
-- (c) The University of Glasgow 2004
--
-----------------------------------------------------------------------------
{-# OPTIONS -Wall -fno-warn-name-shadowing #-}
module RegAlloc.Liveness (
... | mcmaniac/ghc | compiler/nativeGen/RegAlloc/Liveness.hs | bsd-3-clause | 34,755 | 0 | 22 | 12,949 | 7,433 | 3,774 | 3,659 | -1 | -1 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE Over... | rfranek/duckling | Duckling/Duration/NB/Corpus.hs | bsd-3-clause | 1,172 | 0 | 9 | 365 | 189 | 117 | 72 | 29 | 1 |
module System.IO.Streams.Serialize where
import Data.ByteString
import Data.Serialize
import System.IO.Streams as Streams
decodeFromStream :: Serialize a => InputStream ByteString -> IO (InputStream a)
decodeFromStream = Streams.map (fromEither . decode)
where
fromEither (Left s) =... | WraithM/peertrader-backend | src/System/IO/Streams/Serialize.hs | bsd-3-clause | 473 | 0 | 9 | 98 | 142 | 74 | 68 | 10 | 2 |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
{-# OPTIONS_HADDOCK not-home #-}
-- |Internal functions used to implement the functions exported by
-- "Test.WebDriver.Commands". These may be useful for implementing non-standard
-- webdriver commands.
module Test.WebDriver.Commands.In... | zerobuzz/hs-webdriver | src/Test/WebDriver/Commands/Internal.hs | bsd-3-clause | 3,893 | 0 | 14 | 831 | 683 | 385 | 298 | 56 | 2 |
{- |
Module : ./CommonLogic/OMDocImport.hs
Description : OMDoc-to-CommonLogic conversion
Copyright : (c) Iulia Ignatov, DFKI Bremen 2009, Eugen Kuksa, Uni Bremen 2011
License : GPLv2 or higher, see LICENSE.txt
Maintainer : eugenk@informatik.uni-bremen.de
Stability : experimental
Portability : port... | spechub/Hets | CommonLogic/OMDocImport.hs | gpl-2.0 | 7,266 | 0 | 16 | 2,288 | 2,219 | 1,079 | 1,140 | 133 | 5 |
main :: Bool -> ()
main _ | True = ()
| False = ()
| roberth/uu-helium | test/staticwarnings/Guards2.hs | gpl-3.0 | 59 | 0 | 7 | 23 | 39 | 18 | 21 | 3 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/ValidateConfigurationSettings.hs | mpl-2.0 | 6,570 | 0 | 15 | 1,265 | 822 | 492 | 330 | 102 | 1 |
module ExternalImports
(module X
)
where
-------------------------------------------------------- as X
import Cardano.BM.Data.Aggregated as X (Measurable (..))
import Cardano.BM.Data.BackendKind as X
import Cardano.BM.Data.LogItem as X
import ... | deepfire/mood | src/ExternalImports.hs | agpl-3.0 | 6,830 | 0 | 6 | 3,383 | 1,266 | 888 | 378 | 80 | 0 |
import Control.Monad (void)
import qualified Graphics.UI.Threepenny as UI
import Graphics.UI.Threepenny.Core
{-----------------------------------------------------------------------------
Enabled
------------------------------------------------------------------------------}
main :: IO ()
main = startGUI defaultC... | yuvallanger/threepenny-gui | samples/InputElements.hs | bsd-3-clause | 1,143 | 0 | 15 | 269 | 373 | 175 | 198 | 24 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TupleSections #-}
module Eta.DeSugar.DsUsage (
-- * Dependency/fingerprinting code (used by MkIface)
mkUsageInfo, mkUsedNames, mkDependencies
) where
#include "HsVersions.h"
import Eta.Main.DynFlags
import Eta.Main.HscTypes
import Eta.TypeCheck.TcRnTypes
import Eta.Basic... | rahulmutt/ghcvm | compiler/Eta/DeSugar/DsUsage.hs | bsd-3-clause | 11,256 | 0 | 20 | 3,823 | 1,497 | 818 | 679 | 134 | 6 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, DeriveFunctor,
DeriveDataTypeable, PatternGuards #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
{-| TT is the core language of Idris. The language has:
* Full dependent types
* A hierarchy of universes, with cumulativity: Type : Type1... | Enamex/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | 71,139 | 0 | 20 | 22,855 | 26,517 | 13,438 | 13,079 | -1 | -1 |
module L01.Optional where
-- class Optional<A> {
-- Optional(A a) {} // Full
-- Optional() {} // Empty
-- }
data Optional a = Full a | Empty deriving (Eq, Show)
mapOptional :: (a -> b) -> Optional a -> Optional b
mapOptional _ Empty = Empty
mapOptional f (Full a) = Full (f a)
bindOptional :: Optional a ->... | juretta/course | src/L01/Optional.hs | bsd-3-clause | 559 | 0 | 9 | 143 | 242 | 123 | 119 | 14 | 1 |
module LetIn1 where
--A definition can be demoted to the local 'where' binding of a friend declaration,
--if it is only used by this friend declaration.
--Demoting a definition narrows down the scope of the definition.
--In this example, demote the local 'pow' to 'sq'
--This example also aims to test the demoting a ... | mpickering/ghc-exactprint | tests/examples/transform/LetIn1.hs | bsd-3-clause | 517 | 0 | 9 | 158 | 87 | 45 | 42 | 7 | 2 |
module Jhc.Prim.Bits where
-- this declares the built in unboxed types.
-- no code is brought in by this module, it just
-- brings the names into scope, so it is okay to
-- have platform specific definitions here.
-- The CTYPE of the raw types is declared in src/DataConstructors.hs
data Bits1_ :: #
data Bits8_ :: ... | hvr/jhc | lib/jhc-prim/Jhc/Prim/Bits.hs | mit | 1,176 | 31 | 5 | 249 | 166 | 117 | 49 | -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="fr-FR">
<title>Eval Villain Add-On</title>
<maps>
<homeID>evalvillain</homeID>
<mapref ... | kingthorin/zap-extensions | addOns/evalvillain/src/main/javahelp/org/zaproxy/addon/evalvillain/resources/help_fr_FR/helpset_fr_FR.hs | apache-2.0 | 972 | 77 | 67 | 157 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE GADTs #-}
-----------------------------------------------------------------------------
--
-- Debugging data
--
-- Association of debug data on the Cmm level, with methods to encode it in
-- event log format for later inclusion in profiling event logs.
--
--------------------------------------------------... | mcschroeder/ghc | compiler/cmm/Debug.hs | bsd-3-clause | 14,390 | 0 | 18 | 4,801 | 3,308 | 1,726 | 1,582 | 226 | 10 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANG... | wherkendell/diagrams-contrib | src/Diagrams/Lens.hs | bsd-3-clause | 3,351 | 0 | 11 | 776 | 802 | 433 | 369 | 58 | 2 |
import Control.Exception as E
-- This test shows what hpc can really do.
main = do
print ("Hello")
foo "Hello"
E.catch (print (badCase 22 44))
(\ e -> print (e :: E.ErrorCall))
E.catch (print (badCase 22 (error "Foo")))
(\ e -> print (e :: E.ErrorCall))
E.catch (print "Bark")
(... | ttuegel/hpc | tests/function/tough.hs | bsd-3-clause | 1,059 | 0 | 13 | 377 | 454 | 223 | 231 | 38 | 4 |
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!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">
<title>GeoTIFF IO Help</title>
<maps>
<homeID>top</homeID>
<map... | arraydev/snap-engine | snap-geotiff/src/main/javahelp/org/esa/snap/snap/geotiff/docs/help.hs | gpl-3.0 | 771 | 54 | 44 | 165 | 283 | 143 | 140 | -1 | -1 |
{-# LANGUAGE DataKinds, PolyKinds, RankNTypes, GADTs #-}
module T7481 where
import Data.Kind (Type)
import Data.Proxy
data D a where
D1 :: a -> D a
D2 :: (a~Int) => D a
D3 :: forall k (a::k) b. Proxy a -> D b
data Foo :: D Type -> Type
| sdiehl/ghc | testsuite/tests/polykinds/T7481.hs | bsd-3-clause | 247 | 0 | 8 | 59 | 97 | 56 | 41 | -1 | -1 |
module Test20 where
f y xs = [x | x <- xs] + y
| SAdams601/HaRe | old/testing/refacSlicing/Test20_TokOut.hs | bsd-3-clause | 49 | 0 | 8 | 16 | 29 | 16 | 13 | 2 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Web.Slack.WebAPI
( SlackConfig(..)
, makeSlackCall
-- * Methods
, rtm_start
, chat_postMessage
, reactions_add_message
) where
import Control.Lens hiding ((??))
import Control.Mo... | mpickering/slack-api | src/Web/Slack/WebAPI.hs | mit | 3,177 | 0 | 14 | 724 | 944 | 493 | 451 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
module ChaostreffScheduler where
import Protolude
import Data.Time
import Data.List ((!!), groupBy, concat, head)
import Lektor
import Event
import AppCfg
import Git
schedule :: (MonadIO m, MonadReader AppCfg m) => m ()... | section77/chaostreff-scheduler | src/ChaostreffScheduler.hs | mit | 4,121 | 0 | 14 | 760 | 1,213 | 638 | 575 | 69 | 1 |
-- Exercise 1
toDigits :: Integer -> [Integer]
toDigits 0 = []
toDigits n = toDigits (n `div` 10) ++ [n `mod` 10]
toDigitsRev :: Integer -> [Integer]
toDigitsRev 0 = []
toDigitsRev n = [n `mod` 10] ++ toDigitsRev (n `div` 10)
--Exercise 2
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther
reverse' :: [Int... | diminishedprime/.org | reading-list/cis194/homework_01.hs | mit | 393 | 0 | 8 | 72 | 183 | 102 | 81 | -1 | -1 |
module Main where
import System.Environment
import Commands
data Command = Help
| List
| Freeze
| Install
| Uninstall
| Error
instance Show Command where
show Help = "Help"
show List = "List"
show Freeze = "Freeze"
show Install = "Ins... | pepegar/vkg-haskell | src/Main.hs | mit | 861 | 0 | 9 | 229 | 259 | 135 | 124 | 34 | 1 |
module Main (main) where
import Test.Framework (Test, defaultMain)
import qualified OptCrackerTests as OptCrackerTests
import qualified UserManagementTests as UserManagementTests
main :: IO ()
main = defaultMain testSuite
testSuite :: [Test]
testSuite = [ OptCrackerTests.suite
, UserManagementTests.suite... | AstralMining/astral-mining-server | test/TestMain.hs | mit | 323 | 0 | 6 | 51 | 75 | 47 | 28 | 9 | 1 |
module Main where
import System.Environment
import System.IO
import System.Console.ANSI
import Data.Char
import Data.Maybe
import Data.List
import Data.Either
import Control.Monad
import Text.Megaparsec
import Text.Megaparsec.Expr
import Text.Megaparsec.String
import qualified Text.Megaparsec.Lexer as L
import Parse.... | akindle/hdlint | Parse.hs | mit | 4,229 | 0 | 13 | 891 | 1,285 | 619 | 666 | 108 | 2 |
{-|
Module: Y2015.D05
Description: Advent of Code Day 05 Solutions.
License: MIT
Maintainer: @tylerjl
Solutions to the day 05 set of problems for <adventofcode.com>.
-}
module Y2015.D05
( clean
, isNice
, isNicer
, thriceVoweled
, twiceRow
) where
import Y2015.Util ((<&&>))
import Data.List (gr... | tylerjl/adventofcode | src/Y2015/D05.hs | mit | 1,839 | 0 | 9 | 367 | 387 | 220 | 167 | 42 | 1 |
callmin = min 9 10
callmax = max 9 10
-- These two are equivalent.
evaluate1 = succ 9 + max 5 4 + 1
evaluate2 = (succ 9) + (max 5 4) + 1
-- infix notation
divide1 = div 92 10
divide2 = 92 `div` 10 | v0lkan/learning-haskell | session-002/prefix.hs | mit | 198 | 0 | 8 | 49 | 92 | 48 | 44 | 6 | 1 |
-- |
-- Implementation of dumb random AI
module Agent.Random (
RandomAgent
) where
import Control.Monad.State.Strict
import System.Random
import ToServer
import FromServer
import Agent
-- | Contains a generator for random moves
data RandomAgent = AS { gen :: StdGen }
instance Agent RandomAgent where
newAgent ... | adamse/mmc2 | src/Agent/Random.hs | mit | 460 | 0 | 12 | 97 | 140 | 77 | 63 | 14 | 0 |
-- Fibo akin
-- https://www.codewars.com/kata/5772382d509c65de7e000982
module Codewars.G964.Fibkind(comp, lengthSupUK) where
s = 1 : 1 : zipWith3 f s (tail s) [2..]
where f a b i = s !! (i - a) + s !! (i - b)
lengthSupUK :: Int -> Int -> Int
lengthSupUK n k = length . filter (>= k) . take n $ s
comp :: Int -> I... | gafiatulin/codewars | src/5 kyu/Fibkind.hs | mit | 396 | 0 | 11 | 92 | 196 | 105 | 91 | 7 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (replicateM)
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BC
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import qualified Data.Text.Lazy as TL
import qualified Database.Redis as R
import Network.URI (U... | JustinUnger/haskell-book | ch22/shawty.hs | mit | 2,602 | 0 | 21 | 673 | 874 | 443 | 431 | 77 | 4 |
{-# htermination (>=) :: Ord a => a -> a -> Bool #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_GTEQ_1.hs | mit | 53 | 0 | 2 | 13 | 3 | 2 | 1 | 1 | 0 |
import Common
-- Since I don't know how many numbers there are, any of the answers might be correct.
main = print $ scanl (+) 0 [ x | x <- [10..], sum [ product [1..y] | y <- (toDigits x) ] == x]
| lekto/haskell | Project-Euler-Solutions/problem0034.hs | mit | 197 | 0 | 15 | 45 | 73 | 39 | 34 | 2 | 1 |
-- file: Martingale.hs
-- a program to simulate the martingale doubling system
import System.Random (randomR, newStdGen, StdGen)
import System.Environment (getArgs)
import Control.Monad (replicateM)
red = [1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36]
martingale :: StdGen -> Bool
martingale = martingale' 1 0
ma... | anthonybrice/MATH352 | hw1/Martingale.hs | gpl-3.0 | 927 | 3 | 12 | 207 | 378 | 202 | 176 | 24 | 2 |
{-# LANGUAGE DeriveFunctor #-}
module Data.Rhythm.Parser where
import Control.Applicative
import Control.Monad
import qualified Control.Category as Cat
import Control.Arrow
import qualified Data.EventList.Relative.TimeBody as RTB
import qualified Data.EventList.Absolute.TimeBody as ATB
import qualified Numeric.NonNega... | mtolly/rhythm | src/Data/Rhythm/Parser.hs | gpl-3.0 | 3,272 | 0 | 16 | 714 | 1,309 | 702 | 607 | 70 | 2 |
--
-- see:
-- * http://en.wikipedia.org/wiki/Luhn_algorithm
-- * http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Haskell
--
module Luhn
(checks, addCheckDigit)
where
import Control.Arrow
import Data.Char
import Data.List
type FullNumber = String
type PartialNumber = String
ch... | c0c0n3/hAppYard | za-id-gen/Luhn.hs | gpl-3.0 | 894 | 0 | 12 | 196 | 258 | 155 | 103 | 17 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.