code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE OverloadedStrings #-}
module DockerCompose.SpecialChars where
import Data.Text.Lazy as L
data SpecialChar
= Space
| Colon
| Hyphen
| NewLine
| Equals
| BlankChar
| SpecialChar :. SpecialChar
deriving (Eq, Show)
toText :: SpecialChar -> L.Text
toText Space = " "
toText Colon = "... | amarpotghan/docker-compose-dsl | src/DockerCompose/SpecialChars.hs | bsd-3-clause | 533 | 0 | 7 | 119 | 171 | 96 | 75 | 23 | 1 |
{-# LANGUAGE ConstrainedClassMethods #-}
{-|
The machinery used by "Typechecker.Typechecker" and
"Typechecker.Capturechecker" for handling errors and backtracing.
-}
module Typechecker.TypeError (Backtrace
,emptyBT
,Pushable(push)
... | parapluu/encore | src/types/Typechecker/TypeError.hs | bsd-3-clause | 45,929 | 0 | 20 | 13,446 | 9,719 | 4,938 | 4,781 | -1 | -1 |
{- | Script to demonstrate Calculations and other Operations on Signals -}
-- module Demo_Signal where
import qualified EFA.Signal.Plot as Plot
import qualified EFA.Signal.Signal as S
import EFA.Signal.SignalFill ((.-), (./), (.*))
import EFA.Signal.Signal (PSignal, TSignal, Scal, FFSignal)
import EFA.Utility.Async... | energyflowanalysis/efa-2.1 | demo/signal/Main.hs | bsd-3-clause | 3,307 | 0 | 14 | 615 | 1,073 | 593 | 480 | 86 | 1 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Trustworthy #-}
module Control.Monad.Skeleton.Internal (Cat(..), transCat, (|>), viewL, transKleisli) where
import Control.Arrow
import Unsafe.Coerce
-- | Type-aligned catenable queue
data C... | fumieval/monad-skeleton | src/Control/Monad/Skeleton/Internal.hs | bsd-3-clause | 1,186 | 0 | 13 | 295 | 534 | 278 | 256 | 30 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneD... | kumasento/accelerate | Data/Array/Accelerate/Array/Data.hs | bsd-3-clause | 25,248 | 454 | 12 | 6,516 | 6,215 | 3,278 | 2,937 | 434 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Universum
import qualified Data.List.NonEmpty as NonEmpty
import Test.QuickCheck (Property, Result (..), conjoin,
counterexample, ioProperty, label, property,
... | input-output-hk/pos-haskell-prototype | x509/test/Main.hs | mit | 4,810 | 0 | 14 | 1,097 | 972 | 547 | 425 | 92 | 2 |
module System.Console.Questioner.Autocomplete
where
| yamadapc/stack-run | unix/System/Console/Questioner/Autocomplete.hs | mit | 54 | 0 | 3 | 5 | 8 | 6 | 2 | 1 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
module Graphics.UI.Bottle.Direction
( Direction(..), coordinates
) where
import Prelude.Compat
import qualified Control.Lens as Lens
import Control.Lens.Operators
import Data.Vector.Vector2 (Vector2(..))
import Graphics.UI.Bottle.Rect ... | da-x/lamdu | bottlelib/Graphics/UI/Bottle/Direction.hs | gpl-3.0 | 724 | 0 | 8 | 144 | 197 | 117 | 80 | 15 | 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-emr/gen/Network/AWS/EMR/ListBootstrapActions.hs | mpl-2.0 | 5,650 | 0 | 14 | 1,291 | 848 | 496 | 352 | 105 | 1 |
{-# LANGUAGE ScopedTypeVariables, UndecidableInstances, ConstraintKinds, GADTs, DataKinds, KindSignatures #-}
{-# OPTIONS -Wall #-}
module Language.Hakaru.Simplifiable (Simplifiable(mapleType)) where
import Prelude hiding (Real)
--import Data.Proxy (Proxy(..)) -- Is in Prelude for modern GHC?
import Data.Typeable (Ty... | bitemyapp/hakaru | Language/Hakaru/Simplifiable.hs | bsd-3-clause | 2,841 | 0 | 12 | 599 | 874 | 452 | 422 | -1 | -1 |
module Protocol.Persistence where
import General.Config (Config(..))
import General.Persistence
( PersistentBlockHeader(..)
, KeySet(..)
, EntityField(..)
, PersistentUTXO
, PersistentTransaction(..)
)
import General.Types (HasNetwork(..), HasPool(..))
import General.Hash (Hash(..))
import BitcoinCore.Keys... | clample/lamdabtc | backend/src/Protocol/Persistence.hs | bsd-3-clause | 5,259 | 0 | 17 | 957 | 1,533 | 800 | 733 | 124 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedLists #-}
module OSRSpec (spec) where
import Data.Either (isRight, isLeft)
import qualified Data.Vector.Storable as St
import TestUtils
import Arbitrary ((~==))
import OSR
import GDAL (Pair(..))
spec :: Spec
spec = do
describe "SpatialReference" $ do
... | meteogrid/bindings-gdal | tests/OSRSpec.hs | bsd-3-clause | 1,649 | 0 | 20 | 442 | 425 | 215 | 210 | 39 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Distribution.Types.UnitId
( UnitId, unUnitId, mkUnitId
, DefUnitId
, unsafeMkDefUnitId
, unDefUnitId
, newSimpleUnitId
, mkLegacyUnitId
, getHSLibraryName
, InstalledPackageId -- backwa... | mydaum/cabal | Cabal/Distribution/Types/UnitId.hs | bsd-3-clause | 4,151 | 0 | 12 | 699 | 453 | 284 | 169 | 44 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Mem.StableName
-- Copyright : (c) The University of Glasgow 2001
-- License : BS... | sdiehl/ghc | libraries/base/GHC/StableName.hs | bsd-3-clause | 3,909 | 0 | 11 | 786 | 342 | 202 | 140 | 28 | 2 |
-- Copyright (c) 2015 Eric McCorkle. 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, this list of conditi... | emc2/compiler-misc | src/Data/Position/BasicPosition.hs | bsd-3-clause | 8,991 | 0 | 15 | 2,257 | 2,211 | 1,199 | 1,012 | 167 | 2 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
module Handler.Faq
( getFaqR
) where
import Import
data Faq = Faq
{ hash :: String
, question :: String
, answer :: Html
}
faqs :: [Faq]
faqs =
[ Faq "purpose" "What's the purpose of this site?" [shamlet|\
<p>Haskell has a v... | danse/haskellers | Handler/Faq.hs | bsd-2-clause | 3,426 | 0 | 10 | 648 | 158 | 95 | 63 | 19 | 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="ru-RU">
<title>Повторное тестирование надстройки </title>
<maps>
<homeID>retest</homeID>
... | thc202/zap-extensions | addOns/retest/src/main/javahelp/org/zaproxy/addon/retest/resources/help_ru_RU/helpset_ru_RU.hs | apache-2.0 | 1,045 | 77 | 66 | 158 | 521 | 261 | 260 | -1 | -1 |
module A2 where
import Control.Parallel.Strategies (rpar, runEval)
fib 1 = 1
fib n
= (n1_2 + n2) + 1
where
n1 = fib (n - 1)
n2 = fib (n - 2)
n1_2
=
runEval
(do n1_2 <- rpar n1
return n1_2)
| RefactoringTools/HaRe | old/testing/evalMonad/A2AST.hs | bsd-3-clause | 278 | 0 | 12 | 131 | 104 | 55 | 49 | 12 | 1 |
{-# LANGUAGE FlexibleInstances, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-full-laziness #-}
-- cabal install judy
import Control.Monad (forM_)
import Criterion.Config
import Criterion.Main
import Criterion.Types
import qualified Data.IntMap as I
import qualified Data.Judy as J
import qualified Data.Map as M
import... | bgamari/criterion | examples/Judy.hs | bsd-2-clause | 1,479 | 0 | 11 | 466 | 446 | 233 | 213 | 34 | 1 |
import Foreign.C
import Foreign.Marshal.Array
import Foreign.Storable
import Control.Concurrent
-- The test works only on UNIX like.
-- unportable bits:
import qualified System.Posix.Internals as SPI
import qualified System.Posix.Types as SPT
pipe :: IO (CInt, CInt)
pipe = allocaArray 2 $ \fds -> do
throwErrnoIfM... | ezyang/ghc | testsuite/tests/rts/T10590.hs | bsd-3-clause | 1,092 | 0 | 14 | 281 | 253 | 132 | 121 | 24 | 1 |
module T2412A where
import {-# SOURCE #-} T2412 ( Baz )
type Bar = Baz
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/T2412A.hs | bsd-3-clause | 74 | 0 | 5 | 18 | 19 | 13 | 6 | 3 | 0 |
module Y2021.M04.D22.Solution where
{--
What's the opposite of Kung Fu Fighting?
I think, actually, we're not looking for the opposite of super-cool fighting-
styles, but their dual.
So, what's the dual of Kung Fu Fighting?
That's a much easier question to ask, and to answer.
--}
import Data.Maybe (mapMaybe)
impo... | geophf/1HaskellADay | exercises/HAD/Y2021/M04/D22/Solution.hs | mit | 1,579 | 0 | 8 | 255 | 152 | 94 | 58 | 15 | 1 |
module Paths where
import System.FilePath
type Hash = String
type BranchName = String
out :: FilePath
out = "site" </> "out"
resultsOf, reportOf, summaryOf, logsOf :: Hash -> FilePath
graphFile :: String -> FilePath
branchSummaryOf, branchMergebaseOf :: BranchName -> FilePath
logsOf hash = "logs" </> hash <.> "log... | nomeata/gipeda | src/Paths.hs | mit | 682 | 0 | 7 | 113 | 206 | 113 | 93 | 16 | 1 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | HackerRank/FunctionalProgramming/Recursion/stringReductions.hs | mit | 450 | 0 | 5 | 67 | 19 | 12 | 7 | 2 | 1 |
-----------------------------------------------------------------------------
--
-- Module : TypeNum.Test.PosInt
-- Copyright :
-- License : MIT
--
-- Maintainer : -
-- Stability :
-- Portability :
--
-- |
--
module TypeNum.Test.PosInt where
import TypeNum.Test.Common
import TypeNum.Integer.Positive... | fehu/TypeNumerics | test/TypeNum/Test/PosInt.hs | mit | 1,677 | 0 | 18 | 402 | 394 | 189 | 205 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module Database.EventSafe.Types
( ResourceRef(..)
, Resource(..)
, EventPool(..)
, EventPoolM(..)
, StorableEvent(..)
) where
import Control.Monad
import Data.List
import qualified Data.ByteString.Lazy as BSL
-... | thoferon/eventsafe | src/Database/EventSafe/Types.hs | mit | 3,991 | 0 | 12 | 1,054 | 623 | 346 | 277 | 52 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Network.Octohat.Types ( Member(..)
, MemberWithKey(..)
, Team(..)
, TeamPermission(..)
, Repo(..)
... | finlay/octohat | src/Network/Octohat/Types.hs | mit | 11,378 | 0 | 14 | 3,673 | 1,746 | 996 | 750 | 153 | 2 |
{-
Author: Pranav Vishnu Ramabhadran
-}
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}
module Responses where
import qualified Data.ByteString as BS
import Data.Text (Text, unpack, split, pack, dropAround, toLower, words)
import Data.Aeson
import GHC.Generics
import Data.List
import qualified Data.Trie as T
impor... | pvrnav/haskell-twitter-bot | Responses.hs | mit | 5,123 | 36 | 22 | 1,137 | 1,556 | 813 | 743 | 110 | 8 |
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber x = if x > 100 then x else x*2
noneArg = "None Arg" | williamHuang5468/LearningHaskell | CH2 Ready Go/FirstFunction.hs | mit | 129 | 0 | 6 | 31 | 62 | 31 | 31 | 4 | 2 |
module Handler.Sitemap (getSitemapR) where
import Import
import Yesod.Sitemap
--import Stackage.Database
getSitemapR :: Handler TypedContent
getSitemapR = track "Handler.Sitemap.getSitemapR" $ sitemap $ do
cacheSeconds $ 60 * 60 * 6
priority 1.0 $ HomeR
priority 0.9 $ OldSnapshotBranchR LtsBranch []
... | fpco/stackage-server | src/Handler/Sitemap.hs | mit | 2,511 | 0 | 12 | 625 | 243 | 118 | 125 | 20 | 1 |
isPalindrome :: (Eq a) => [a] -> Bool
isPalindrome xs = xs == (reverse xs)
main :: IO ()
main = do
let last = isPalindrome [1, 2, 2, 1]
print last
| zeyuanxy/haskell-playground | ninety-nine-haskell-problems/vol1/06.hs | mit | 156 | 0 | 11 | 41 | 85 | 44 | 41 | 6 | 1 |
{-# LANGUAGE Safe #-}
{- |
This module re-exports the routing and controller modules.
See each module for their corresponding documentation.
Though you can implement a controller using the methods supplied by
this module (actually, "Hails.Web.Router"), we recommend using the
DSLs provided by "Hails.Web.Frank" or "H... | scslab/hails | Hails/Web.hs | mit | 588 | 0 | 5 | 89 | 62 | 43 | 19 | 10 | 0 |
module Timestamp
(Timestamp)
where
import Data.Ratio
import Data.Word
data Timestamp = Timestamp Word64
instance Show Timestamp where
show (Timestamp a) = show a
instance Eq Timestamp where
(==) (Timestamp a) (Timestamp b) = (==) a b
instance Ord Timestamp where
compare (Timestamp a) (Timestamp b) = compar... | IreneKnapp/ozweb | Haskell/Timestamp.hs | mit | 1,455 | 0 | 10 | 287 | 658 | 328 | 330 | 36 | 0 |
module Euler006 (euler6) where
euler6 :: Int
euler6 = (sumn 100) ^ 2 - sum (map (^2) [1..100])
sumn :: Int -> Int
sumn x = (x * (x + 1)) `div` 2 | TrustNoOne/Euler | haskell/src/Euler006.hs | mit | 147 | 0 | 9 | 35 | 90 | 51 | 39 | 5 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module Language.Vigil.Compile where
import Language.Common.Annotation
import Language.Common.Misc ( unFix )
import Language.GoLite.Types ( stringFrom... | djeik/goto | libgoto/Language/Vigil/Compile.hs | mit | 36,903 | 0 | 33 | 15,528 | 9,374 | 4,532 | 4,842 | 758 | 32 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE... | benkolera/haskell-ldap-classy | LDAP/Classy.hs | mit | 9,454 | 0 | 16 | 2,761 | 2,873 | 1,540 | 1,333 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
import qualified Data.Proxy as Proxy
import qualified Data.Text as Text
import qualified Lackey
import qualified Servant.API as Servant
import qualified Test.Hspec as Hspec
main :: IO ()
main =
Hspec.hspec
. Hspec.parallel
. Hspec.describe "Lackey"
... | tfausak/lackey | source/test-suite/Main.hs | mit | 8,851 | 0 | 21 | 3,945 | 2,178 | 1,072 | 1,106 | 213 | 2 |
module Parser
( Parser.parse
) where
import Control.Monad.Error (throwError)
import Text.ParserCombinators.Parsec
import Types
parseNumber = do
sign <- option "" (string "-")
value <- try parseFloat <|> parseInt
return $ Number . read $ sign ++ value
where parseInt = many1 digit
pars... | dstruthers/Agate | Parser.hs | mit | 1,572 | 0 | 12 | 440 | 524 | 243 | 281 | 54 | 2 |
module Parser (parse) where
import qualified TailRecGrammar as H
import Lexer
import Control.Monad.Trans.State.Lazy
import Control.Monad
type Parse = State (Token, [Token])
parse :: String -> H.E
parse s = evalState (advance >> e) (undefined, mathLex s)
advance :: Parse ()
advance = do
(_, x:xs) <- get
put (x, ... | w-shackleton/MathParse | Parser.hs | gpl-2.0 | 1,131 | 0 | 14 | 311 | 536 | 266 | 270 | 46 | 3 |
{- |
Module : $Header$
License : GPLv2 or higher, see LICENSE.txt
Maintainer : nevrenato@gmail.com
Stability : provisional
Portability : portable
Description :
Instance of class Pretty for hybrid logic
with an arbitrary logic below.
-}
module TopHybrid.Print_AS (printNamedFormula) where
import Co... | nevrenato/Hets_Fork | TopHybrid/Print_AS.hs | gpl-2.0 | 3,014 | 0 | 14 | 873 | 1,012 | 499 | 513 | 50 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : ./TPTP/Prover/ProverState.hs
Description : Help functions for all automatic theorem provers.
Copyright : (c) Rainer Grabbe
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : needs ... | gnn/Hets | TPTP/Prover/ProverState.hs | gpl-2.0 | 4,667 | 0 | 12 | 1,294 | 804 | 435 | 369 | 74 | 5 |
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Maybe where
import Data.Bool
data Maybe a = Just a | Nothing
maybe n _ Nothing = n
maybe _ f (Just x) = f x
isJust Nothing = False
isJust _ = True
isNothing Nothing = True
isNothing _ = False
fromJust (Just x) = x
-- fromJust Nothing = error "Maybe.from... | bredelings/BAli-Phy | haskell/Data/Maybe.hs | gpl-2.0 | 828 | 0 | 10 | 260 | 265 | 136 | 129 | 21 | 2 |
{-# LANGUAGE PatternGuards,ViewPatterns #-}
-- | Simplify pass over the rich language:
--
-- * Inlines local non-recursive definitions,
-- * Eliminates known-case:
-- - when the scrutinee expression is a constructor
-- - by inlining/eliminating the scrutinee variable
-- * Beta reduction
--
-- These passes ... | danr/hipspec | src/HipSpec/Lang/SimplifyRich.hs | gpl-3.0 | 3,428 | 0 | 20 | 1,051 | 989 | 512 | 477 | -1 | -1 |
module RayMarch.Field where
import RayMarch.Types
sub :: Field -> Field -> Field
sub f g p = f p`max`(-g p) | phi16/RayMarch | RayMarch/Field.hs | gpl-3.0 | 109 | 1 | 8 | 21 | 52 | 29 | 23 | 4 | 1 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
module Jebediah.MIDI.Waldorf.Blofeld
where
import Jebediah.MIDI.Instrument
import Sound.MIDI.Message.Channel (Body)
data Blofeld = Blofeld
blofeld :: Blofeld
blofeld = Blofeld
ctrlNames :: [(Int, String)]
ctrlNames = sorted
[ (27, "Oscillator 1: Rang... | mmarx/jebediah | src/Jebediah/MIDI/Waldorf/Blofeld.hs | gpl-3.0 | 464 | 0 | 8 | 98 | 122 | 72 | 50 | 14 | 1 |
-- This Source Code Form is subject to the terms of
-- the Mozilla Public License, v. 2.0. If a copy of
-- the MPL was not distributed with this file, You
-- can obtain one at http://mozilla.org/MPL/2.0/.
{-# LANGUAGE OverloadedStrings #-}
module Network.Wai.Middleware.Gunzip (gunzip) where
import Control.Applicativ... | twittner/wai-middleware-gunzip | src/Network/Wai/Middleware/Gunzip.hs | mpl-2.0 | 2,207 | 0 | 15 | 631 | 601 | 318 | 283 | 43 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.StorageTransfer
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozi... | rueshyna/gogol | gogol-storage-transfer/gen/Network/Google/StorageTransfer.hs | mpl-2.0 | 8,047 | 0 | 15 | 1,735 | 793 | 570 | 223 | 190 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-binaryauthorization/gen/Network/Google/Resource/BinaryAuthorization/Projects/Attestors/ValidateAttestationOccurrence.hs | mpl-2.0 | 6,488 | 0 | 16 | 1,352 | 780 | 456 | 324 | 126 | 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/FloodlightActivities/Get.hs | mpl-2.0 | 5,101 | 0 | 19 | 1,228 | 821 | 474 | 347 | 113 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-support/gen/Network/AWS/Support/AddCommunicationToCase.hs | mpl-2.0 | 5,757 | 0 | 10 | 1,152 | 664 | 401 | 263 | 77 | 1 |
module Gigasecond (fromDay) where
import Data.Time.Calendar (Day, addDays)
fromDay :: Day -> Day
fromDay = addDays gigasecInDays
where gigasecInDays = floor (1e9 / 86400 :: Float)
| mscoutermarsh/exercism_coveralls | assignments/haskell/gigasecond/example.hs | agpl-3.0 | 182 | 0 | 9 | 28 | 60 | 35 | 25 | 5 | 1 |
-- | Minimize the Rosenbrock function (plus a trivial constraint) using
-- the View-based NLP interface.
-- Unfortunately, at the moment there only types here are (JV ) compound types
-- so the use of Views aren't fully illustrated.
-- todo: comment up the multiple shooting code as an example
{-# OPTIONS_GHC -Wall #-}... | ghorn/dynobud | dynobud/examples/BasicNlp.hs | lgpl-3.0 | 1,930 | 0 | 14 | 595 | 668 | 371 | 297 | 50 | 1 |
{-# LANGUAGE TypeFamilies #-}
-- | define a map from Node -> View, to keep track of what's in view.
-- not much in here, but I expect it'll expand in the future.
module Jaek.UI.Views (
ViewMap
,View (..)
,ViewChange (..)
,Zoom (..)
,isWaveView
,iMap
,mapFromTree
,getView
,updateMap
,slideX
,sl... | JohnLato/jaek | src/Jaek/UI/Views.hs | lgpl-3.0 | 3,820 | 0 | 14 | 942 | 1,444 | 759 | 685 | 104 | 2 |
--
-- テスト方法
--
-- ghci> :load Test.hs
-- [2 of 2] Compiling Test ( Test.hs, interpreted )
-- Ok, modules loaded: Test, Hangman.
-- ghci> mapM_ runTestTT test_mostFreqPatternByLetter
module Test
(
test_mostFreqPatternByLetter
, test_patternByLetter
, test_replaceAt
, test_replaceAtByPattern
, test... | yamanobori-old/CheatHangman | Test.hs | unlicense | 4,528 | 0 | 16 | 1,268 | 1,221 | 721 | 500 | 96 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
module Language.Gamma.Parser where
import Control.Applicative
import Control.Lens
import Data.Proxy
import qualified Data.HashSet as HashSet
import Text.Trifecta
import Text.Parser.Token.Style
import Language.Gamma.Types
import Language.Gamma.Parser.Commented
data GammaSty... | agrif/gammac | src/Language/Gamma/Parser.hs | apache-2.0 | 1,637 | 0 | 17 | 338 | 576 | 297 | 279 | -1 | -1 |
module Foundation where
import Database.Persist.Sql (ConnectionPool, runSqlPool)
import Import.NoFoundation
import Text.Hamlet (hamletFile)
-- Used only when in "auth-dummy-login" setting is enabled.
import Yesod.Auth.Dummy
import Yesod.Auth.OpenId (authOpenId, IdentifierType (Claime... | Reyu/CanidComics | Foundation.hs | apache-2.0 | 10,709 | 0 | 16 | 2,782 | 1,528 | 824 | 704 | -1 | -1 |
-- | Miscellaneous general functions and Show, Eq, and Ord instances for PortID
{-# LANGUAGE FlexibleInstances, UndecidableInstances, StandaloneDeriving #-}
module Database.MongoDB.Internal.Util where
import Control.Applicative (Applicative(..), (<$>))
import Network (PortID(..))
import Data.UString as U (cons, appe... | mongodb/mongoDB-haskell | Database/MongoDB/Internal/Util.hs | apache-2.0 | 4,076 | 4 | 14 | 774 | 1,315 | 710 | 605 | -1 | -1 |
module HSH.ShellStateSpec (spec) where
import Test.Hspec
import Test.QuickCheck
import Control.Monad.State
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Maybe
import HSH.MonitoredDirectory
import HSH.ShellState
genChar :: Gen Char
genChar = elements ['\0' .. '\xff']
genUndefinedEnvV... | jessekempf/hsh | test/HSH/ShellStateSpec.hs | bsd-2-clause | 2,240 | 0 | 19 | 433 | 539 | 274 | 265 | 41 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QSize.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:31
Warning : this file is machine generated - do not mod... | uduki/hsQt | Qtc/Core/QSize.hs | bsd-2-clause | 7,033 | 0 | 13 | 1,304 | 2,478 | 1,275 | 1,203 | -1 | -1 |
module Drasil.SWHS.References (citations, bueche1986, incroperaEtAl2007, koothoor2013, lightstone2012,
parnasClements1986, parnas1972, parnasClements1984, smithLai2005) where
import Language.Drasil
import Data.Drasil.People (jBueche, fIncropera, dDewitt, tBergman, aLavine,
mLightstone)
import Data.Drasil.Citati... | JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/SWHS/References.hs | bsd-2-clause | 1,255 | 0 | 8 | 163 | 248 | 150 | 98 | 26 | 1 |
import Distribution.Simple
import Distribution.Simple.PreProcess
import Distribution.Simple.Utils
import Distribution.PackageDescription
import Distribution.Simple.LocalBuildInfo
import Data.Char
import System.Exit
import System.IO
import System.Process
import System.Directory
main = let hooks = simpleUserHooks
... | carlostome/uu-parsinglib-tyerr | Setup.hs | bsd-3-clause | 1,460 | 0 | 16 | 373 | 351 | 181 | 170 | 34 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
-------------------------------------------------------------... | fpinsight/hadron | src/Hadron/Run/FanOut.hs | bsd-3-clause | 6,338 | 0 | 23 | 1,618 | 1,526 | 787 | 739 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
import Database.Persist
import Database.Persist.Sqlite
import Model
main :: IO ()
main = runSqlite ":memory:" $ runMigration migrateAll
| amir/ghc-dashboard | src/Migrate.hs | bsd-3-clause | 174 | 1 | 6 | 24 | 44 | 22 | 22 | 6 | 1 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module QuickCover.GroupRec where
import Data.Function (on)
import Data.Set as Set
concatSet :: Ord a => Set (Set a) -> Set a
concatSet = Set.foldr Set.union Set.empty
splitBy :: Ord a => (a -> a -> Bool) -> [a] -> Set [a]
splitBy _ [] ... | shayan-najd/QuickCover | QuickCover/GroupRec.hs | bsd-3-clause | 965 | 0 | 11 | 255 | 455 | 246 | 209 | 21 | 3 |
-- !!! Testing the IO module
module Main where
import IO
-- assume we've got a Directory impl
import Directory ( removeFile )
exHandler :: (IOError -> Bool)
-> IO ()
-> IO ()
exHandler pred x = x `catch` (\ err -> if pred err then
putStrLn "got expected IO error"
else
print err)
-- shou... | FranklinChen/Hugs | tests/libs/ioTest1.hs | bsd-3-clause | 3,165 | 10 | 12 | 725 | 1,157 | 509 | 648 | 114 | 2 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE BangPatterns #-}
module Language.Clojure.Cost where
import Language.Clojure.AST
import Language.Clojure.Lang
costUsingl :: Usingl u -> Int
{-# INLINE costUsingl #-}
costUsingl (UString u) = 1
costUsingl (USep u) = 1
costUsingl (UCollTy u) = 1
costUsingl (UFormTy u) = 1
costUsingl ... | nazrhom/vcs-clojure | src/Language/Clojure/Cost.hs | bsd-3-clause | 938 | 0 | 7 | 169 | 371 | 188 | 183 | 28 | 1 |
{-|
Module : Data.Boltzmann.System.Tuner.Algebraic
Description : Interface utilities with the Paganini tuner.
Copyright : (c) Maciej Bendkowski, 2017-2021
License : BSD3
Maintainer : maciej.bendkowski@tcs.uj.edu.pl
Stability : experimental
General utilities managing the IO interface between Boltz... | maciej-bendkowski/boltzmann-brain | Data/Boltzmann/System/Tuner/Algebraic.hs | bsd-3-clause | 6,181 | 0 | 14 | 1,694 | 2,243 | 1,184 | 1,059 | 134 | 2 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstan... | haskell-servant/cretheus | Data/Cretheus.hs | bsd-3-clause | 8,995 | 0 | 12 | 2,088 | 2,568 | 1,356 | 1,212 | 151 | 6 |
import System.Environment (getArgs)
import Data.List.Split (splitOn)
import Data.List (intercalate)
revgrou :: [Int] -> Int -> [Int]
revgrou xs y | length xs < y = xs
| otherwise = reverse (take y xs) ++ revgrou (drop y xs) y
revgroup :: [String] -> [Int]
revgroup [xs, ys] = revgrou (map ... | nikai3d/ce-challenges | moderate/reverse_groups.hs | bsd-3-clause | 528 | 0 | 14 | 133 | 246 | 123 | 123 | 13 | 1 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1998
This module contains definitions for the IdInfo for things that
have a standard form, namely:
- data constructors
- record selectors
- method and superclass selectors
- primitive operations
-}
{-# LANGUAGE CPP #-}
module MkId (
... | bitemyapp/ghc | compiler/basicTypes/MkId.hs | bsd-3-clause | 54,258 | 0 | 21 | 14,840 | 7,139 | 3,887 | 3,252 | 556 | 6 |
-- #hide
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PeekPoke
-- Copyright : (c) Sven Panne 2003
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven_panne@yahoo.com
-- Stability : pr... | OS2World/DEV-UTIL-HUGS | libraries/Graphics/Rendering/OpenGL/GL/PeekPoke.hs | bsd-3-clause | 2,400 | 0 | 12 | 523 | 741 | 365 | 376 | 53 | 1 |
module Problems.Problem14
( getSolution
) where
-- This is stupid slow
getSolution :: Int
getSolution = snd $ maximum $ map (\n -> (findLengthSimple n, n)) [1 .. 1000000]
findLengthSimple :: Int -> Int
findLengthSimple 1 = 1
findLengthSimple seed = 1 + findLengthSimple (nextCollatz seed)
nextCollatz :: Int ... | sarangj/eulerhs | src/Problems/Problem14.hs | bsd-3-clause | 393 | 0 | 10 | 82 | 148 | 83 | 65 | 9 | 2 |
--------------------------------------------------------------------
-- |
-- Module : Language.While.Parser
--
-- Provides parsing of while-language code.
-- Supports reading either a file or stdin, resulting in an AST.
module Language.While.Parser (loadFile, loadStdin) where
import Control.Applicative ((<$>), (<*))
... | davnils/while-lang-parser | Language/While/Parser.hs | bsd-3-clause | 4,911 | 0 | 12 | 983 | 1,296 | 659 | 637 | 119 | 2 |
----------------------------------------------------------------
-- Модуль приложения
-- Скрипты графического интерфейса (HScript)
-- Утилиты генератора языка JavaScript
----------------------------------------------------------------
module WebUI.Scripts.JavaScript.HJSUtils
( smartTrim, smartTrimStr
, smartT... | iqsf/HFitUI | src/WebUI/Scripts/JavaScript/HJSUtils.hs | bsd-3-clause | 4,235 | 0 | 13 | 1,507 | 906 | 486 | 420 | 74 | 8 |
{-# LANGUAGE CPP #-}
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 702)
{-# LANGUAGE Trustworthy #-}
#endif
{-# LANGUAGE DeriveDataTypeable #-}
module Data.IterIO.Inum
(-- * Base types
Inum, Onum
-- * Concatenation and fusing operators
, (|$), (.|$), cat, lcat, (|.), (.|)
-- * Except... | scslab/iterIO | Data/IterIO/Inum.hs | bsd-3-clause | 53,177 | 0 | 18 | 12,602 | 7,321 | 4,030 | 3,291 | 360 | 6 |
{-# LANGUAGE ScopedTypeVariables #-}
module Pipe where
import TestMain
import Helper
import AST hiding (Process)
import Render
import Control.Distributed.Process
import Control.Distributed.Process.Serializable
import Data.Typeable.Internal
import GHC.Int
test_pipe :: IO ()
test_pipe = mytest pipe
pipe :: Process ... | abakst/symmetry | checker/src/cloud-haskell-tests/Pipe.hs | mit | 1,096 | 0 | 12 | 319 | 399 | 207 | 192 | 38 | 1 |
{-# LANGUAGE ExplicitForAll #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Database.Persist.Sql.Orphan.PersistUnique
()
where
import Control.Exception (throwIO)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Reader (ask)
import qualified Data.Conduit.List as CL
import Data.Function (on)
impo... | paul-rouse/persistent | persistent/Database/Persist/Sql/Orphan/PersistUnique.hs | mit | 4,653 | 0 | 23 | 1,664 | 1,191 | 596 | 595 | 103 | 1 |
import Data.List
main :: IO ()
main = putStrLn . show . head . flip (drop) (primes) $ 10000
primes :: [Int]
primes = filter (isPrime) generator
generator :: [Int]
generator = (2::Int):(3::Int) : (concat [[6*k-1, 6*k+1] | k <- [1..]])
isPrime :: Int -> Bool
isPrime x = (not . even $ x) && (length (factors x) == 2)
... | jrgdiz/euler | 7.hs | mit | 593 | 0 | 11 | 144 | 335 | 182 | 153 | 16 | 2 |
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Main
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Main (main)... | fmapfmapfmap/amazonka | amazonka-kms/test/Main.hs | mpl-2.0 | 522 | 0 | 8 | 103 | 76 | 47 | 29 | 9 | 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-kinesis/gen/Network/AWS/Kinesis/MergeShards.hs | mpl-2.0 | 6,225 | 0 | 12 | 1,279 | 598 | 373 | 225 | 79 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Ambiata.Cli.Json (
toAddress
, toAccess
, toSecret
, toToken'
, toText
, addressToText
) where
import Data.Aeson
import Data.Aeson.Types
import Data.Text.Encod... | ambiata/tatooine-cli | src/Ambiata/Cli/Json.hs | apache-2.0 | 1,107 | 0 | 8 | 269 | 284 | 151 | 133 | 33 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module TemplateHaskellCodeExecFFI where
import Language.Haskell.TH.Syntax (lift)
import Language.Haskell.TH
import ForeignImport (pureFfiDep)
foo = $([|$(lift . pureFfiDep $ 4)|])
| robinp/haskell-indexer | haskell-indexer-backend-ghc/testdata/basic/TemplateHaskellCodeExecFFI.hs | apache-2.0 | 215 | 0 | 6 | 24 | 43 | 29 | 14 | 6 | 1 |
module CustomSql where
import Database.HaskellDB
import Database.HaskellDB.DBLayout
import Database.HaskellDB.Query
import Database.HaskellDB.PrimQuery
import System.Time
--
-- Fields for getting results of a given type
--
data Timefield = Timefield
instance FieldTag Timefield where fieldName _ = "timefield"
timefie... | m4dc4p/haskelldb | test/old/CustomSql.hs | bsd-3-clause | 1,042 | 0 | 9 | 166 | 313 | 165 | 148 | 23 | 1 |
-- | Dynamically lookup up values from modules and loading them.
module DynamicLoading (
#ifdef GHCI
-- * Force loading information
forceLoadModuleInterfaces,
forceLoadNameModuleInterface,
forceLoadTyCon,
-- * Finding names
lookupRdrNameInModule,
... | mcmaniac/ghc | compiler/main/DynamicLoading.hs | bsd-3-clause | 7,988 | 0 | 24 | 2,090 | 1,398 | 743 | 655 | 1 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Yesod.WebSockets
( -- * Core API
WebSocketsT
, webSockets
, receiveData
, sendTextData
, sendBinaryData
-- * Conduit API
, sourceWS
, sinkWSText
, sinkW... | ygale/yesod | yesod-websockets/Yesod/WebSockets.hs | mit | 4,363 | 0 | 18 | 1,056 | 1,062 | 584 | 478 | 68 | 1 |
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE helpset
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN"
"http://java.sun.com/products/javahelp/helpset_1_0.dtd">
<?SecureFTP this is data for SecureFTP ?>
<helpset version="1.0">
<!-- title -->
<title>Aide sur Sec... | robinpowell24/secureftp | src/com/glub/secureftp/client/resources/help/SecureFTP_fr.hs | apache-2.0 | 1,133 | 88 | 48 | 249 | 423 | 220 | 203 | -1 | -1 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
module T16133 where
import Data.Kind
import Language.Haskell.TH hiding (Type)
data P (a :: k) = MkP
$([d| f :: Int
f = $(varE 'id `appTypeE` conT ''Int `appE` litE (integerL 42))
type P' = $(conT ''P `appKindT` conT ''Type) |])
| sdiehl/ghc | testsuite/tests/th/T16133.hs | bsd-3-clause | 304 | 0 | 6 | 64 | 48 | 32 | 16 | 9 | 0 |
module Data.IP.Mask where
import Data.Bits
import Data.IP.Addr
import Data.Word
maskIPv4 :: Int -> IPv4
maskIPv4 len =
IP4 $ complement $ 0xffffffff `shift` (-len)
maskIPv6 :: Int -> IPv6
maskIPv6 len =
IP6 $ toIP6Addr $ bimapTup complement $
(0xffffffffffffffff, 0xffffffffffffffff) `shift128` (-... | kazu-yamamoto/iproute | Data/IP/Mask.hs | bsd-3-clause | 1,231 | 0 | 10 | 300 | 563 | 325 | 238 | 34 | 1 |
{-# OPTIONS_JHC -fno-prelude -fffi -funboxed-values #-}
-- | helper routines for deriving(Enum) instances
-- these routines help out the compiler when
-- deriving enums.
module Jhc.Inst.PrimEnum(
enum_succ,
enum_pred,
enum_fromTo,
enum_fromThen,
enum_fromThenTo,
enum_toEnum,
enum_from
,... | hvr/jhc | lib/jhc/Jhc/Inst/PrimEnum.hs | mit | 4,686 | 17 | 24 | 1,420 | 1,529 | 826 | 703 | -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>Call Home Add-On</title>
<maps>
<homeID>callhome</homeID>
<mapref locati... | kingthorin/zap-extensions | addOns/callhome/src/main/javahelp/org/zaproxy/addon/callhome/resources/help_sr_CS/helpset_sr_CS.hs | apache-2.0 | 966 | 77 | 67 | 157 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Polymorphism where
foo :: a -> a -> a
foo = undefined
foo' :: forall a. a -> a -> a
foo' = undefined
bar :: a -> b -> (a, b)
bar = undefined
bar' :: forall a b. a -> b -> (a, b)
bar' = undefined
baz :: a -> (a -> [a -> a] -> b) -> b
baz = u... | sdiehl/ghc | testsuite/tests/hiefile/should_compile/hie007.hs | bsd-3-clause | 1,168 | 0 | 12 | 347 | 682 | 380 | 302 | 41 | 1 |
{-# LANGUAGE RebindableSyntax #-}
module Bug where
data Maybe a = Just a | Nothing
foo :: [Maybe a] -> [a]
foo xs = [ x | Just x <- xs ]
| olsner/ghc | testsuite/tests/rebindable/T11216A.hs | bsd-3-clause | 140 | 0 | 8 | 35 | 58 | 33 | 25 | 5 | 1 |
{-# LANGUAGE DataKinds #-}
module T13025 where
import T13025a
type MyRec = Rec '[ '("A",Int), '("B",Int), '("C",Int) ]
getC :: MyRec -> Int
getC = getField (Proxy::Proxy '("C",Int))
doubleC :: MyRec -> MyRec
doubleC r = setC (2 * (getC r)) r
where setC = set . (Field :: Int -> Field '("C",Int))
main :: IO ()
main... | olsner/ghc | testsuite/tests/simplCore/should_compile/T13025.hs | bsd-3-clause | 384 | 0 | 12 | 79 | 204 | 113 | 91 | 11 | 1 |
-- ImageToVector.hs
-- Compiles to a library.
-- This library contains utility functions for loading, converting, and
-- manipulating images.
module ImageToVector
( loadImage
, loadImageToVector
, loadImages
, loadImagesToVectors
, imageToVector
, chop
, changeResolution
, vectorToImage
) where
import Data.Packed.Vect... | IsToomersCornerBeingRolledRightNow/principalComponentAnalysisViaSingularValueDecomposition | ImageToVector.hs | mit | 2,625 | 0 | 16 | 679 | 1,039 | 537 | 502 | 62 | 3 |
module Main where
minIdx :: [Int] -> Int -> Int
minIdx (x:[]) idx = idx
minIdx (x:xs) idx = if x < minimum xs then idx else (minIdx xs (idx + 1))
maxIdx :: [Int] -> Int -> Int
maxIdx (x:[]) idx = idx
maxIdx (x:xs) idx = if x > maximum xs then idx else (maxIdx xs (idx + 1))
swap :: [Int] -> Int -> [Int]
swap [] _ = [... | funfunStudy/algorithm | haskell/src/main/haskell/lilysHomework/Main.hs | mit | 1,614 | 0 | 10 | 367 | 833 | 451 | 382 | 34 | 2 |
{-# LANGUAGE Rank2Types #-}
module GA where
import System.Random
import Data.List
import Data.Maybe
import Control.Monad.Random
type GA a g = GeneticAlgorithm a -> g -> [a] -> ([a],g)
data GeneticAlgorithm a = GeneticAlgorithm {
fitness :: a -> Float,
mutate :: RandomGen g => (a,g) -> (a,g),
cross :: Rando... | Stratege/Coevolutionary-Neural-Network | GA.hs | mit | 3,390 | 46 | 18 | 862 | 1,632 | 865 | 767 | 55 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Writer.Formats.Ltl
-- License : MIT (see the LICENSE file)
-- Maintainer : Felix Klein (klein@react.uni-saarland.de)
--
-- Transforms a specification to a pure LTL formula.
--
------------------------------------... | reactive-systems/syfco | src/lib/Writer/Formats/Ltl.hs | mit | 1,989 | 0 | 10 | 454 | 393 | 219 | 174 | 36 | 1 |
import Data.List
coFactors :: Int -> [Int]
coFactors n = filter (test n) [1..(intSqrt n)] --generates factors upto sqrt
where intSqrt = floor . sqrt . fromIntegral
test n x = mod n x == 0
factors :: Int -> [Int]
factors n = (fmap (div n) fac) ++ fac
where fac = coFactors n
prime n = (length $ factors n... | johnprock/euler | p3.hs | mit | 498 | 1 | 9 | 114 | 225 | 115 | 110 | 13 | 1 |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module ViewModels.NameValuePairViewModel where
import Data.Text
import Data.Data
data NameValuePairVM = NameValuePairVM {
name :: Text,
value :: Text
} deriving (Data, Typeable) | itsuart/fdc_archivist | src/ViewModels/NameValuePairViewModel.hs | mit | 239 | 0 | 8 | 33 | 49 | 30 | 19 | 8 | 0 |
module Data.Unique.Global
( getUnique
) where
import Data.Word
import Data.IORef
import System.IO.Unsafe
import Data.Unique.Internal
global :: IORef Word
global = unsafePerformIO $ newIORef 0
{-# NOINLINE global #-}
getUnique :: a -> IO (Unique a)
getUnique x = do
i <- readIORef global
writeIORef global $ ... | treep/data-unique | Data/Unique/Global.hs | mit | 376 | 0 | 9 | 73 | 118 | 62 | 56 | 15 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.