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 : Data.Functor.Constant
-- Copyright : (c) Ross Paterson 2010
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : ross@soi.city.ac.uk
-- Stability : experimental
-- Portability : portable
--
-- The constant functor.
module Data.Functor.Constant (
Constant(..),
) w... | technogeeky/d-A | src/Data/Functor/d-Constant.hs | gpl-3.0 | 929 | 0 | 8 | 184 | 255 | 145 | 110 | 16 | 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="en-GB">
<title>Script Console</title>
<maps>
<homeID>top</homeID>
<mapref l... | zapbot/zap-extensions | addOns/scripts/src/main/javahelp/org/zaproxy/zap/extension/scripts/resources/help/helpset.hs | apache-2.0 | 972 | 81 | 67 | 169 | 417 | 213 | 204 | -1 | -1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Wrap0 () where
import Language.Haskell.Liquid.Prelude (liquidError, liquidAssertB)
import Data.Function (on)
import Data.Ord (comparing)
data WrapType b a = WrapType {getVect :: b, getVal :: a}
instance Eq (WrapType [Double] a) where
(==) = (==) `o... | mightymoose/liquidhaskell | tests/neg/wrap1.hs | bsd-3-clause | 772 | 0 | 8 | 189 | 260 | 145 | 115 | 16 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TemplateHaskell #-}
module Data.TarIndex (
TarIndex,
TarIndexEntry(..),
TarEntryOffset,
lookup,
construct,
#ifdef TESTS
prop_lookup, prop,
#endif
) where
import Data.SafeCopy (base, deriveSafeCopy)
import Da... | ocharles/hackage-server | Data/TarIndex.hs | bsd-3-clause | 6,444 | 0 | 14 | 1,531 | 1,451 | 783 | 668 | 83 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wno-name-s... | greenlaw110/FrameworkBenchmarks | frameworks/Haskell/wizzardo-inline/wizzardo-http-benchmark/src/main/haskell/DbHandler.hs | bsd-3-clause | 5,006 | 0 | 17 | 991 | 677 | 371 | 306 | -1 | -1 |
module ShouldFail where
class Foo o where
(:+) :: o -> o -> o
| ryantm/ghc | testsuite/tests/parser/should_fail/readFail031.hs | bsd-3-clause | 69 | 4 | 5 | 21 | 29 | 16 | 13 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Sindre.Lib
-- License : MIT-sty... | Athas/Sindre | Sindre/Lib.hs | mit | 6,827 | 0 | 20 | 2,445 | 1,846 | 984 | 862 | 117 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-sqlapplicationconfiguration.html
module Stratosphere.ResourceProperties.Kinesi... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationSqlApplicationConfiguration.hs | mit | 2,192 | 0 | 12 | 159 | 176 | 105 | 71 | 23 | 1 |
mean :: Fractional a => [a] -> a
mean list = sum(list) / fromIntegral(length(list))
| iduhetonas/haskell-projects | HelloWorld/mean.hs | mit | 84 | 0 | 9 | 14 | 50 | 25 | 25 | 2 | 1 |
-- How Many Numbers?
-- http://www.codewars.com/kata/55d8aa568dec9fb9e200004a
module Codewars.G964.Howmany where
import Data.Char (digitToInt)
import Data.List (sort, group)
selNumber :: Int -> Int -> Int
selNumber n d = length . filter (((== xs) . map head . group . sort $ xs) && (all (<= d) . zipWith (-) (tail xs)... | gafiatulin/codewars | src/6 kyu/Howmany.hs | mit | 370 | 0 | 16 | 65 | 153 | 85 | 68 | 5 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2021.M02.D19.Exercise where
{--
Okay, we have our ~120k wine-reviews uploaded, great! Did we do it correctly?
Hm.
Today's Haskell problem.
We've verified before (Y2021.M02.D04.Solution) that wine-labels and wineries
weren't redundant, and, if they were, we eliminated tho... | geophf/1HaskellADay | exercises/HAD/Y2021/M02/D19/Exercise.hs | mit | 3,055 | 0 | 12 | 549 | 377 | 225 | 152 | 34 | 1 |
{-
| Intro screen module implementation
The game shows this screen during startup. It contains some
information about your system like available memory, inputs
and sound devices installed.
The base image stored into SIGNON.OBJ file and contains empty
boxes and title "One moment.." at the bottom. When resou... | vTurbine/w3dhs | src/Game/Intro.hs | mit | 2,801 | 0 | 15 | 688 | 641 | 340 | 301 | 51 | 1 |
-- The fusc function -- Part 1
-- https://www.codewars.com/kata/570409d3d80ec699af001bf9
module Fusc where
fusc :: Int -> Int
fusc 0 = 0
fusc 1 = 1
fusc n | even n = fusc (n `div` 2)
| otherwise = fusc (n `div` 2) + fusc (1 + (n `div` 2))
| gafiatulin/codewars | src/7 kyu/Fusc.hs | mit | 248 | 0 | 11 | 58 | 104 | 56 | 48 | 6 | 1 |
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.LSP.Types.WorkspaceEdit where
import ... | wz1000/haskell-lsp | lsp-types/src/Language/LSP/Types/WorkspaceEdit.hs | mit | 15,912 | 0 | 16 | 3,766 | 2,453 | 1,345 | 1,108 | 222 | 3 |
-- -------------------------------------------------------------------------------------
-- 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/Companies/VMWare/macLearning.hs | mit | 1,516 | 0 | 11 | 384 | 410 | 218 | 192 | 34 | 4 |
module ProjectEuler.Problem110
( problem
, pickInOrder'
) where
import Petbox
import qualified Data.List.Match as LMatch
import ProjectEuler.Types
{-
This is basically the more difficult version of Problem108,
my plan is to revisit that problem first and come back
with perhaps some more insights.
By ... | Javran/Project-Euler | src/ProjectEuler/Problem110.hs | mit | 2,310 | 0 | 10 | 506 | 266 | 146 | 120 | 23 | 2 |
{-# LANGUAGE
GeneralizedNewtypeDeriving
, MultiParamTypeClasses
, DeriveGeneric
, DeriveDataTypeable
, OverloadedStrings
#-}
module Veva.Types.NewUser
( NewUser(..)
, Email(..)
, Password(..)
) where
import Data.JSON.Schema
import Hasql.Postgres (Postgres)
import Data.Typeable (Type... | L8D/veva | lib/Veva/Types/NewUser.hs | mit | 1,251 | 0 | 8 | 434 | 282 | 167 | 115 | 43 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
--------------------------------------------------------------------------------
import Control.Concurrent (forkIO)
import Control.Monad (forever, unless)
import Control.Monad.Trans (liftIO)
import Network.Socket (withSocketsDo)
import Data.Text ... | joshcough/Scrabble | web/client/Main.hs | mit | 1,127 | 0 | 17 | 226 | 263 | 141 | 122 | 24 | 1 |
module Hiker where
import Data.List
bookPrice = 8.0
discount 2 = 2 * bookPrice * 0.95
discount 3 = 3 * bookPrice * 0.9
discountPrice' :: [Double] -> Double
discountPrice' [nbBooks] = bookPrice * nbBooks
discountPrice' (0:books) = discountPrice' books
discountPrice' [x, y] = (discount 2) + discountPrice' [x-1, y-1]
--... | murex/murex-coding-dojo | Paris/2015/2015-03-05-KataPotter-Haskell-Randori/hiker.hs | mit | 724 | 1 | 9 | 117 | 267 | 148 | 119 | -1 | -1 |
module Network.Skype.API.Carbon (
Connection,
connect
) where
import Control.Applicative
import Control.Concurrent (ThreadId, forkIO)
import Control.Concurrent.STM.TChan (TChan, newBroadcastTChanIO, writeTChan)
import Control.Concurrent.STM.TMVar
import Control.Monad (when)
import Control.Monad.Error (Error, strMs... | emonkak/skype4hs | src/Network/Skype/API/Carbon.hs | mit | 5,674 | 0 | 17 | 1,058 | 1,288 | 658 | 630 | 131 | 2 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Qwu.DB.Table.Post where
import Qwu.DB.Table.Account (AccountId)
import GHC.Generics
import Control.Lens (makeLenses... | bryangarza/qwu | src/Qwu/DB/Table/Post.hs | mit | 1,744 | 0 | 10 | 431 | 444 | 255 | 189 | 50 | 1 |
-- Copyright 2013 Thomas Szczarkowski
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as Char8
import qualified Data.ByteString.Base64 as Base64
import Data.Char
import Data.Function
import Data.Array.IArray
import Data.List
import Data.Bits
import Data.Word
import Control.Monad
import Te... | tom-szczarkowski/matasano-crypto-puzzles-solutions | set1/Solutions.hs | mit | 6,384 | 0 | 15 | 1,562 | 1,909 | 985 | 924 | -1 | -1 |
module Apriori where
import FileIO
import HasseTree
main path file minSupport = do
dataSet <- importData path file
let frequents = apriori dataSet minSupport
exportResult path file $ toString frequents
-- return $ frequents
apriori :: [ItemSet] -> Int -> HasseTree
apriori dataSet minSupport = aprior... | gaetjen/FunFreakyPatMan | src/Apriori.hs | mit | 4,518 | 0 | 15 | 865 | 1,513 | 772 | 741 | 64 | 2 |
module DTS.Toolkit (DTSToolkit(..), fileToKit, getProperty, getNodeCompatibles) where
import DTS
import Control.Applicative hiding ((<|>), many)
import Data.List
import Data.MultiMap (MultiMap)
import qualified Data.MultiMap as MultiMap
import System.FilePath.Posix
import Text.ParserCombinators.Parsec
data DTSToolki... | elopez/dtschecker | DTS/Toolkit.hs | gpl-2.0 | 4,196 | 2 | 16 | 1,148 | 1,676 | 864 | 812 | 80 | 8 |
module Cake.Process (processIO, Cake.Process.system) where
import Cake.Core
import System.IO
import Control.Applicative
import Control.Monad.Trans
import System.Process as P
import Data.List
import System.Exit
import Control.Monad
quote :: String -> String
quote = show
maybeM :: Applicative m => (a -> m Handle) -> M... | jyp/Cake | Cake/Process.hs | gpl-2.0 | 1,131 | 0 | 19 | 228 | 472 | 239 | 233 | 30 | 1 |
{-| Implementation of cluster-wide logic.
This module holds all pure cluster-logic; I\/O related functionality
goes into the /Main/ module for the individual binaries.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the term... | kawamuray/ganeti | src/Ganeti/HTools/Cluster.hs | gpl-2.0 | 73,805 | 1 | 23 | 23,395 | 15,964 | 8,647 | 7,317 | 1,200 | 7 |
{-# LANGUAGE RecordWildCards #-}
module Capture.X11 where
import Data
import Graphics.X11
import Graphics.X11.Xlib.Extras
import Control.Monad
import Control.Exception (bracket)
import System.IO.Error (catchIOError)
import Control.Applicative
import Data.Maybe
import Data.Time.Clock
import System.IO
import qualified D... | nomeata/darcs-mirror-arbtt | src/Capture/X11.hs | gpl-2.0 | 5,089 | 0 | 15 | 1,412 | 1,505 | 730 | 775 | 105 | 2 |
{- Piffle, Copyright (C) 2007, Jaap Weel. 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. This program is distribut... | jaapweel/piffle | src/Compiler.hs | gpl-2.0 | 4,643 | 0 | 18 | 1,270 | 1,040 | 557 | 483 | 96 | 2 |
--------------------------------------------------------------------------------
-- |
-- Module : Web.Pandoc
-- Copyright : (C) 2014 Yorick Laupa
-- License : (see the file LICENSE)
--
-- Maintainer : Yorick Laupa <yo.eight@gmail.com>
-- Stability : provisional
-- Portability : non-portable
--
-------------------------... | YoEight/personal-site | Web/Pandoc.hs | gpl-3.0 | 1,540 | 0 | 6 | 160 | 164 | 104 | 60 | 16 | 1 |
functionC x y =
case (x > y) of
True -> x
False -> y
ifEvenAdd2 n =
case even n of
True -> n + 2
False -> n
nums x =
case compare x 0 of
LT -> -1
GT -> 1
_ -> 0
| dkensinger/haskell | haskellbook/casepractice.hs | gpl-3.0 | 201 | 0 | 8 | 87 | 102 | 50 | 52 | 13 | 3 |
{- What is a Project? -}
import Data.Time.Calendar
class DatePeriod p where
startDay:: p -> Day
startDay = diffDays endDay durationDays
endDay:: p -> Day
endDay = addDays startDay durationDays
durationDays:: p -> Day
durationDays = diffDays endDay startDay
| FiskerLars/scorg | src/ProjectLogic.hs | gpl-3.0 | 277 | 0 | 7 | 59 | 74 | 39 | 35 | 8 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Database.Design.Ampersand.Output.ToPandoc.ChapterNatLangReqs (
chpNatLangReqs
) where
import Data.Char hiding (Space)
import Data.List
import Data.List.Split
import Data.Maybe
--import Database.Design.Ampersand.Basics
import Database... | 4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/Output/ToPandoc/ChapterNatLangReqs.hs | gpl-3.0 | 15,901 | 5 | 31 | 6,976 | 3,355 | 1,706 | 1,649 | 269 | 34 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE UnicodeSyntax #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Main
-- License : GPL-3
-- Copyright : © Mateusz Kowalczyk, 2014
-- Maintainer : fuuzetsu@fuuzetsu.co.uk
-- Stability : experimental
-- Portability : portable
--
-- Main entry point t... | Fuuzetsu/free-taiko | src/Main.hs | gpl-3.0 | 5,661 | 0 | 19 | 1,746 | 1,739 | 894 | 845 | -1 | -1 |
{-# LANGUAGE TupleSections #-}
-- -----------------------------------------------------------------------------
import Control.Arrow( second )
import Control.Monad( void )
import Data.Array( Array, listArray, assocs, elems, indices, (//), (!) )
import Data.Char( digitToInt )
import Data.List( nub, sort, group, foldl', ... | zhensydow/ljcsandbox | lang/haskell/sudoku/main.hs | gpl-3.0 | 7,478 | 0 | 16 | 1,596 | 2,669 | 1,505 | 1,164 | -1 | -1 |
import TSSP
import Plot
import Data.Complex
import Graphics.Gnuplot.Simple
import Graphics.Gnuplot.Value.Tuple
import File
import System.Process
import Text.Printf
main :: IO ()
main = harmOszSphere
-- main = hydrogen
-- main = harmOsz
harmOszSphere :: IO ()
harmOszSphere = do
let m = 7.43 -- 2.6 m_e
... | KiNaudiz/bachelor | TSSP/test.hs | gpl-3.0 | 4,058 | 0 | 18 | 1,606 | 654 | 370 | 284 | 42 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Instances/GetShieldedInstanceIdentity.hs | mpl-2.0 | 4,399 | 0 | 17 | 1,005 | 470 | 280 | 190 | 84 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Flows/Patch.hs | mpl-2.0 | 7,514 | 0 | 18 | 1,535 | 954 | 560 | 394 | 141 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Mirror.Type... | rueshyna/gogol | gogol-mirror/gen/Network/Google/Mirror/Types/Product.hs | mpl-2.0 | 60,822 | 0 | 36 | 16,033 | 11,481 | 6,653 | 4,828 | 1,235 | 1 |
module Handler.Info.About where
import Import
------------------------------------------------------------------------
getAboutR :: Handler Html
getAboutR = defaultLayout $ do
setTitle "Betty : About"
$(widgetFile "info.about")
------------------------------------------------------------------------
| sajith/betty-web | Handler/Info/About.hs | agpl-3.0 | 313 | 0 | 10 | 34 | 45 | 24 | 21 | 6 | 1 |
{-
Copyright (C) 2009 Andrejs Sisojevs <andrejs.sisojevs@nextmail.ru>
All rights reserved.
For license and copyright information, see the file COPYRIGHT
-}
--------------------------------------------------------------------------
--------------------------------------------------------------------------
... | Andrey-Sisoyev/PCLT-DB | Database/PCLT.hs | lgpl-2.1 | 504 | 0 | 5 | 51 | 37 | 26 | 11 | 3 | 0 |
import Prelude as P
import Data.Map as M
import Data.PQueue.Prio.Min as Q
import Data.List
import Data.Tuple
import Data.Maybe
main :: IO ()
main = do
text <- getLine
let pmf = P.map swap . M.toList $ pmfs text
let chars = P.map fst . M.toList $ countChars text
let emptyCode = M.fro... | dpohanlon/Huffman | huffman.hs | lgpl-3.0 | 2,682 | 0 | 15 | 748 | 1,279 | 657 | 622 | 61 | 1 |
-- vim: ts=2 sw=2 et :
{- |
Provides the 'HistoryItem' data type, representing an entry in ghci's history
listing.
-}
module GHCi.History where
-- | Represents a position in a source file, line and column,
-- counting from 1. (Just as GHCi @:history@ output does.)
data FilePos = FilePos { lineNum :: Int, colNum :... | phlummox/ghci-history-parser | src/GHCi/History.hs | unlicense | 828 | 0 | 8 | 187 | 133 | 83 | 50 | 14 | 1 |
module Main where
import Test.Framework (defaultMain, testGroup)
import CardsTest (tests)
import OpeningBidsTest (tests)
import OpeningResponsesTest (tests)
main :: IO ()
main = defaultMain allTests
where
allTests = [ testGroup "Cards.Tests"
CardsTest.tests
, testGroup "Ope... | derekmcloughlin/BridgeBuddyServer | test/TestSuite.hs | apache-2.0 | 498 | 0 | 9 | 160 | 96 | 54 | 42 | 13 | 1 |
-- Copyright 2018-2021 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed t... | google/hs-ten | ten/src/Data/Ten/Applicative.hs | apache-2.0 | 5,023 | 2 | 14 | 1,082 | 1,537 | 833 | 704 | 90 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module DockerFu where
impor... | lancelet/bored-robot | app/DockerFu.hs | apache-2.0 | 7,852 | 0 | 20 | 2,793 | 1,410 | 753 | 657 | 134 | 4 |
module SSync.JSVectorM (Vector, VectorMonad, (!), write, set, new) where
import Control.Monad (forM_)
import qualified GHCJS.Types as T
import SSync.JSVector.Internal
type Vector = T.JSRef ()
foreign import javascript unsafe "$1[$2]" idx :: Vector -> Int -> IO Int
foreign import javascript unsafe "$1[$2] = $3" upda... | socrata-platform/ssync | src/main/haskell/SSync/JSVectorM.hs | apache-2.0 | 1,038 | 1 | 11 | 202 | 354 | 189 | 165 | 23 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Tct.Trs.Encoding.Interpretation
where
import Data.Maybe (fromMaybe)
import Control.Monad (liftM)
import qualified Data.Foldable as F
import qualified Data.Map.Strict as M
import Data.Monoid ... | ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Encoding/Interpretation.hs | bsd-3-clause | 11,302 | 0 | 19 | 2,862 | 3,457 | 1,840 | 1,617 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.FragmentProgram2
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/FragmentProgram2.hs | bsd-3-clause | 802 | 0 | 4 | 90 | 49 | 39 | 10 | 7 | 0 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.SGIS.Texture4D
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable
--
-... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/SGIS/Texture4D.hs | bsd-3-clause | 1,003 | 0 | 4 | 118 | 79 | 60 | 19 | 15 | 0 |
module Control.Monad.Trans.Wrap
( WrappedMonadT (..)
) where
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
newtype WrappedMonadT m a
= WrapMonadT { unwrapMonadT :: m a
}
instance Monad m => Functor (WrappedMonadT m) where
fmap = liftM
instance Monad m =>... | sonyandy/unify | src/Control/Monad/Trans/Wrap.hs | bsd-3-clause | 754 | 0 | 9 | 167 | 243 | 130 | 113 | 21 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.BuildPaths
-- Copyright : Isaac Jones 2003-2004,
-- Duncan Coutts 2008
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- A bunch o... | garetxe/cabal | Cabal/Distribution/Simple/BuildPaths.hs | bsd-3-clause | 3,551 | 0 | 10 | 635 | 546 | 311 | 235 | 60 | 3 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Data.Geodetic.LLH(
LLH(..)
, HasLLH(..)
) where
import Data.Geodetic.HasDoubles(HasDoubles(doubles))
import Data.Geodetic.LL(HasLL(lL), LL)
import Papa
data LLH =
LLH {
ll ::
LL
, _height ::
Double
} deriving (Eq, Ord,... | NICTA/coordinate | src/Data/Geodetic/LLH.hs | bsd-3-clause | 527 | 0 | 10 | 141 | 188 | 107 | 81 | 26 | 0 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Pretty-printing assembly language
--
-- (c) The University of Glasgow 1993-2005
--
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module X86.Ppr... | frantisekfarka/ghc-dsi | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | 42,504 | 0 | 28 | 13,159 | 12,559 | 6,253 | 6,306 | 815 | 97 |
--------------------------------------------------------------------------------
-- |
-- Module : GalFld.Core.FiniteFields
-- Note : Allgemeine implementierung endlicher Körper
--
--
--
--------------------------------------------------------------------------------
module GalFld.Core.FiniteFields
( FFEle... | maximilianhuber/softwareProjekt | src/GalFld/Core/FiniteFields.hs | bsd-3-clause | 6,503 | 0 | 13 | 1,828 | 2,230 | 1,121 | 1,109 | 112 | 1 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE TypeFamilies #-}
module T17202 where
type family F a
class C1 a
class (forall c. C1 c) => C2 a
class (forall b. (b ~ F a) => C2 a) => C3 a
data Dict c = c => Dict
foo :: forall a. C3 a => Dict (C1 a)
foo = Dict
bar :: forall a. C3 a => Dic... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/T17202.hs | bsd-3-clause | 364 | 0 | 10 | 90 | 170 | 90 | 80 | -1 | -1 |
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable, FlexibleInstances #-}
module Curve where
import Data.Functor.Classes
import qualified Data.List as List
import qualified Data.Set as Set
data Name
= Local Int
| Global String
deriving (Eq, Ord)
data Expression term
= Type
| Implicit
| Variabl... | antitypical/Curve | src/Curve.hs | bsd-3-clause | 5,838 | 0 | 17 | 1,320 | 2,436 | 1,220 | 1,216 | 134 | 8 |
module ReaderPractice where
import Control.Applicative
import Data.Maybe
x :: [Integer]
x = [1, 2, 3]
y :: [Integer]
y = [4, 5, 6]
z :: [Integer]
z = [7, 8, 9]
xs :: Maybe Integer
xs = lookup 3 $ zip x y
ys :: Maybe Integer
ys = lookup 6 $ zip y z
zs :: Maybe Integer
zs = lookup 4 $ zip x y
z' :: Integer -> May... | actionshrimp/haskell-book | src/ReaderPractice.hs | bsd-3-clause | 826 | 0 | 10 | 205 | 460 | 254 | 206 | 34 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds #-}
module Ling.Fmt.Benjamin.Layout where
import Ling.Fmt.Benjamin.Lex
import Data.Maybe (isNothing, fromJust)
-- Generated by the BNF Converter
-- local parameters
topLayout :: Bool
topLayout = True
layoutWords, layoutStopWords :: [String]
layoutW... | np/ling | Ling/Fmt/Benjamin/Layout.hs | bsd-3-clause | 9,839 | 0 | 25 | 3,215 | 2,543 | 1,319 | 1,224 | 189 | 50 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Data.GraphQL.Parser where
import Prelude hiding (takeWhile)
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>), (<*>), (*>), (<*), (<$), pure)
import Data.Monoid (Monoid, mempty)
#endif
import Control.Applicative ((<|>), empty, many, optional)... | timmytofu/graphql-haskell | Data/GraphQL/Parser.hs | bsd-3-clause | 9,103 | 0 | 21 | 1,975 | 2,068 | 1,077 | 991 | 240 | 2 |
module PlaybackState (
onChange
, elapsedTime
) where
import Prelude hiding (mapM_)
import Data.Foldable (mapM_)
import Control.Monad (when, forever)
import Control.Applicative
import Control.Monad.State.Strict (liftIO, evalStateT, gets, modify)
import Da... | haasn/vimus | src/PlaybackState.hs | mit | 3,389 | 0 | 19 | 888 | 820 | 447 | 373 | 52 | 2 |
-- |
-- Provides a typeclass for a general concept of a path into
-- a treelike structure. We have a root or empty path, paths
-- may be concatenated, and a pair of paths may be factored into
-- paths relative to their lowest common ancestor in the tree.
module Unison.Path where
import Control.Applicative
-- | Satis... | nightscape/platform | shared/src/Unison/Path.hs | mit | 1,728 | 0 | 11 | 432 | 461 | 252 | 209 | 29 | 1 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Rank1 where
import Numeric.Natural
import Numeric.Natural.QuickCheck ()
import Data.Typeable
import Data.Name
import Data.Prop
data Rank1 p a = Forall [a] (p a) deriving (Eq, Ord, Show, Read, Functor)
instance Typeable1 p => Typeable1 (R... | kmyk/proof-haskell | Data/Rank1.hs | mit | 876 | 0 | 11 | 158 | 344 | 184 | 160 | 21 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Text.Render (
Render(..), Indenter,
indented, wrapIndented, inNewLine, renderIndented,
renderIndentedStartingAt,
renderTicks
) where
import ClassyPrelude
import qualified Prelude as P
import Control.Monad.Trans (MonadIO(..))... | adnelson/simple-nix | src/Text/Render.hs | mit | 2,667 | 0 | 12 | 606 | 811 | 441 | 370 | 65 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Views.Common (pageT, inp, sel) where
import Data.Text.Lazy (Text)
import Text.Blaze.Html5 hiding (option)
import qualified Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes hiding (name)
import qualified Text.Blaze.Html5.Attributes as A
i... | zalora/sproxy-web | src/Views/Common.hs | mit | 3,496 | 0 | 27 | 1,227 | 956 | 452 | 504 | 59 | 1 |
{-
SkateBackendCode: The C code backend for Skate
Part of Skate: a Schema specification languge
Copyright (c) 2017, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK,... | kishoredbn/barrelfish | tools/skate/SkateBackendCode.hs | mit | 4,806 | 0 | 15 | 1,041 | 1,106 | 594 | 512 | 92 | 1 |
{-# OPTIONS_GHC -F -pgmF inlitpp #-}
# Test document
Hello from my test document!
```haskell hide top
import Data.Time
```
```haskell do
now <- getCurrentTime
```
```haskell do
let later :: UTCTime
later = addUTCTime 100 now
```
```haskell top
f :: Int -> Int
f x = x - 7
```
```haskell eval
f (2+2)
`... | diffusionkinetics/open | inliterate/TestInliteratePreProc.hs | mit | 442 | 8 | 6 | 101 | 102 | 81 | 21 | -1 | -1 |
{- |
Module : Environment
Description : REPL environment
Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt)
License : BSD3
Maintainer : Boya Peng <u3502350@connect.hku.hk>
Stability : stable
Portability : portable
-}
module Environment where
import Data.List.Split
impor... | zhiyuanshi/fcore | repl/Environment.hs | bsd-2-clause | 1,721 | 0 | 12 | 507 | 493 | 273 | 220 | 36 | 2 |
module Graphics.VR.Pal (module Exports) where
import Graphics.VR.Pal.Hands as Exports
import Graphics.VR.Pal.Movement as Exports
import Graphics.VR.Pal.Types as Exports
import Graphics.VR.Pal.Window as Exports
import Graphics.VR.Pal.SDLUtils as Exports
| lukexi/game-pal | src/Graphics/VR/Pal.hs | bsd-3-clause | 262 | 0 | 4 | 34 | 58 | 44 | 14 | 6 | 0 |
-- | Constants describing the DWARF format. Most of this simply
-- mirrors /usr/include/dwarf.h.
module Dwarf.Constants where
import FastString
import Platform
import Outputable
import Reg
import X86.Regs
import Data.Word
-- | Language ID used for Haskell.
dW_LANG_Haskell :: Word
dW_LANG_Haskell = 0x18
-- Thanks... | AlexanderPankiv/ghc | compiler/nativeGen/Dwarf/Constants.hs | bsd-3-clause | 6,141 | 0 | 14 | 1,484 | 1,331 | 755 | 576 | 165 | 3 |
{-# LANGUAGE BangPatterns #-}
module Main where
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad.Trans (liftIO)
import Criterion.Config
import Criterion.Main
import Data.List (foldl')
import qualified Data.Map as M
import Data.Maybe (fromMaybe)
import Prelude hiding (lookup)
main = do
... | DavidAlphaFox/ghc | libraries/containers/benchmarks/Map.hs | bsd-3-clause | 5,969 | 0 | 16 | 1,537 | 2,593 | 1,311 | 1,282 | 112 | 1 |
-- |
-- Copyright : (c) 2010, 2011 Benedikt Schmidt
-- License : GPL v3 (see LICENSE)
--
-- Maintainer : Benedikt Schmidt <beschmi@gmail.com>
-- Portability : GHC only
--
module Theory.UnitTests where
import Term.Builtin.Convenience
import Theory.Tools.IntruderRules
{-
-- EquationStore
----... | rsasse/tamarin-prover | lib/theory/src/Theory/UnitTests.hs | gpl-3.0 | 9,454 | 0 | 11 | 2,187 | 652 | 341 | 311 | 30 | 1 |
module LiftToToplevel.WhereIn1 where
--A definition can be lifted from a where or let to the top level binding group.
--Lifting a definition widens the scope of the definition.
--In this example, lift 'sq' in 'sumSquares'
--This example aims to test add parameters to 'sq'.
sumSquares x y = sq x + sq y
whe... | kmate/HaRe | test/testdata/LiftToToplevel/WhereIn1.hs | bsd-3-clause | 450 | 0 | 7 | 148 | 84 | 44 | 40 | 7 | 2 |
{-# LANGUAGE TypeFamilies, LiberalTypeSynonyms #-}
-- ^ crucial for exercising the code paths to be
-- tested here
module ShouldCompile where
import Data.Kind (Type)
type family Element c :: Type
f :: x -> Element x
f x = undefined
| sdiehl/ghc | testsuite/tests/indexed-types/should_compile/Simple19.hs | bsd-3-clause | 292 | 0 | 6 | 100 | 46 | 28 | 18 | -1 | -1 |
{-# LANGUAGE CPP #-}
-- | Computing fingerprints of values serializeable with GHC's "Binary" module.
module BinFingerprint
( -- * Computing fingerprints
fingerprintBinMem
, computeFingerprint
, putNameLiterally
) where
#include "HsVersions.h"
import GhcPrelude
import Fingerprint
import Binary
import Nam... | ezyang/ghc | compiler/iface/BinFingerprint.hs | bsd-3-clause | 1,418 | 0 | 11 | 356 | 289 | 146 | 143 | -1 | -1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
module Tc269 where
import GHC.Types
{-
-- We'd like this to kind check, but it doesn't today,
-- see Note [Missed opportunity to retain higher-rank kinds]
-- TSyn is in an SCC of its own, so we can read off the
-- kind directly.
data T (p :: forall k. k -> Type)... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/tc269.hs | bsd-3-clause | 565 | 1 | 10 | 126 | 89 | 55 | 34 | -1 | -1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
import Control.Applicative
import Control.Monad
import Data.List hiding (and,or)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Word
import System.Environment
import Text.Printf
import Prelude hiding (and,or)
import MiniSat
import Formu... | mcschroeder/smc | Main.hs | mit | 3,911 | 0 | 24 | 1,286 | 1,341 | 670 | 671 | 106 | 4 |
{-# Language RecordWildCards #-}
-- | Paths whose values are monitroed.
module Galua.Debugger.WatchList where
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Galua.Debugger.ValuePath
data WatchList = WatchList
{ wlNextId :: !Int
, wlItems :: !(IntMap ValuePath)
}
... | GaloisInc/galua | galua-dbg/src/Galua/Debugger/WatchList.hs | mit | 926 | 0 | 11 | 205 | 240 | 138 | 102 | 23 | 1 |
module Y2016.M10.D19.Exercise where
import Data.Map (Map)
import Analytics.Trading.Data.Row (Symbol) -- http://lpaste.net/109658
import Analytics.Trading.Scan.Top5s -- http://lpaste.net/1443717939034324992
-- Below imports are available from 1HaskellADay git repository
import Data.Bag
{--
Let's continue our ... | geophf/1HaskellADay | exercises/HAD/Y2016/M10/D19/Exercise.hs | mit | 2,098 | 0 | 8 | 339 | 106 | 65 | 41 | 9 | 1 |
a +#= b = c
| chreekat/vim-haskell-syntax | test/golden/toplevel/infix-punct.hs | mit | 12 | 0 | 5 | 5 | 12 | 5 | 7 | 1 | 1 |
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Hadoop.Protos.YarnProtos.ContainerTypeProto (ContainerTypeProto(..)) where
import Prelude ((+), (/), (.))
import qualified Prelude as Prelude'
import qualified Data.... | alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/YarnProtos/ContainerTypeProto.hs | mit | 2,581 | 0 | 11 | 385 | 601 | 327 | 274 | 50 | 1 |
module Language.Paradocs.RuleEnv where
import Control.Applicative
import Control.Monad
import Control.Lens
import qualified Data.HashSet as HashSet
import qualified Data.HashMap.Strict as HashMap
import qualified Language.Paradocs.RuleName as RuleName
impo... | pasberth/paradocs | Language/Paradocs/RuleEnv.hs | mit | 1,340 | 0 | 21 | 315 | 391 | 202 | 189 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses,
TemplateHaskell,
FlexibleInstances,
UndecidableInstances,
ViewPatterns,
TupleSections #-}
import Prelude hiding (pi)
import Unbound.LocallyNameless
import Unbound.LocallyNameless.Fresh
import Unbound.LocallyNameless.Op... | JadenGeller/Tart | Sources/Tart.hs | mit | 18,826 | 0 | 32 | 6,098 | 6,129 | 3,035 | 3,094 | 313 | 11 |
{-# LANGUAGE OverloadedStrings, TypeOperators, FlexibleContexts #-}
module Wf.Control.Eff.Run.SessionSpec
( sessionSpec
) where
import Control.Eff (Eff, (:>), Member, SetMember, handleRelay)
import qualified Wf.Control.Eff.Kvs as Kvs (Kvs(..), get)
import Control.Eff.Lift (Lift, runLift)
import Control.Eff.Exception (... | bigsleep/Wf | wf-session/test/Wf/Control/Eff/Run/SessionSpec.hs | mit | 4,352 | 0 | 19 | 1,149 | 1,333 | 749 | 584 | 96 | 1 |
module Main(main) where
main = interact id
| rockdragon/julia-programming | code/haskell/Interact.hs | mit | 44 | 0 | 5 | 8 | 17 | 10 | 7 | 2 | 1 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StandaloneDeriving #-}
module Tracking.Database where
import Database.Persist.TH
import Data.ByteString
impo... | schell/xybish | src/Tracking/Database.hs | mit | 507 | 0 | 7 | 83 | 62 | 39 | 23 | 14 | 0 |
{-# language
MagicHash, BangPatterns, CPP, RankNTypes,
RoleAnnotations, UnboxedTuples, ScopedTypeVariables #-}
{-# options_ghc -fno-full-laziness -fno-warn-name-shadowing #-}
module Data.TrieVector (
Vector(..)
, (|>)
, (!#)
, (!)
, snoc
, Data.TrieVector.foldr
, Data.TrieVector.fol... | AndrasKovacs/trie-vector | Data/TrieVector.hs | mit | 16,616 | 368 | 31 | 5,560 | 5,401 | 2,863 | 2,538 | 394 | 11 |
{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-}
module Haste.JSArray where
import Control.Applicative hiding ((<*>), pure)
import qualified Control.Applicative as Ap ((<*>), pure)
import Control.DeepSeq (NFData, force)
import Control.Monad (liftM, mapM_)
import Data.List (foldl')
import Haste.Foreign
i... | klarh/haste-jsarray | src/Haste/JSArray.hs | mit | 3,944 | 0 | 13 | 658 | 1,655 | 843 | 812 | 85 | 2 |
data Doggies a =
Husky a
| Mastiff a
deriving (Eq, Show)
data DogueDeBordeaux doge =
DogueDeBordeaux doge
-- 1 - Doggies is a type constructor
-- 2 - :kind Doggies :: * -> *
-- 3 - :kind Doggies String :: *
-- 4 - :type Husky 10 :: Num a => Doggies a
-- 5 - :type Husky (10 :: Integer) :: Doggies Integer
--... | ashnikel/haskellbook | ch11/ch11.5_ex.hs | mit | 564 | 0 | 6 | 120 | 46 | 30 | 16 | 6 | 0 |
{-# htermination delListFromFM :: Ord a => FiniteMap (Maybe a) b -> [(Maybe a)] -> FiniteMap (Maybe a) b #-}
import FiniteMap
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/FiniteMap_delListFromFM_9.hs | mit | 126 | 0 | 3 | 22 | 5 | 3 | 2 | 1 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
module Prelude.Source.GHC.Num (
Num((+), (-), (*), negate, abs, signum, fromInteger),
subtract,
) where
import Prelude (
Num((+), (-), (*), negate, abs, signum, fromInteger),
subtract,
)
| scott-fleischman/cafeteria-prelude | src/Prelude/Source/GHC/Num.hs | mit | 244 | 0 | 6 | 51 | 74 | 63 | 11 | 10 | 0 |
-- Зачем это всё?
-- {-# LANGUAGE MultiParamTypeClasses #-}
-- {-# LANGUAGE FunctionalDependencies #-}
-- {-# LANGUAGE FlexibleInstances #-}
import Prelude hiding (lookup)
import qualified Data.Map as M
import qualified Data.List as L
-- (5 баллов)
-- 1. Определить класс MapLike типов, похожих на Map.
-- В нем до... | SergeyKrivohatskiy/fp_haskell | hw07/MapLike.hs | mit | 2,624 | 0 | 14 | 704 | 934 | 490 | 444 | 41 | 0 |
module GenCNF_Queen where
import Data.List
-- It generates CNF file which taken by zChaff tool.
-- CNF file contains constraints for queen problem as clause norm form
p2i (x, y) width = width * (x - 1) + y
atLeastOneQueenInEachRow width =
map (\clause -> intercalate " " $ map show $ map (\p -> p2i p width) clause... | zlqhem/course2013-ModelChecking | SAT_problem/GenCNF_Queen.hs | mit | 1,456 | 0 | 16 | 439 | 711 | 384 | 327 | 24 | 1 |
module Chattp.PersistencePg.Config where
import qualified Data.ByteString.Char8 as BS
import System.Directory
import System.Environment (getEnv)
import System.IO.Error (catchIOError)
import Database.PostgreSQL.Simple
import Network.Socket
defaultConnString :: String
defaultConnString = "dbname='chattp' user='chatt... | Spheniscida/cHaTTP | persistence-pg/Chattp/PersistencePg/Config.hs | mit | 2,140 | 0 | 18 | 469 | 526 | 260 | 266 | 43 | 4 |
module Observable.Measure where
import Control.Monad.Free (iterM)
import Measurable.Core (Measure)
import qualified Measurable.Measures as Measurable
import Observable.Core
-- | Forward-mode measure interpreter. Produces a measure over the model's
-- predictive distribution,
measure :: Model a -> Measure a
measur... | jtobin/observable | Observable/Measure.hs | mit | 692 | 0 | 9 | 133 | 214 | 111 | 103 | 13 | 6 |
module Bonawitz_3_7
where
import Blaze
-- Replicating instance of Bonawitz 3.7
sr :: State
sr = collectStates dummyState [sp, sa, sb, sx]
sp :: State
sp = mkDoubleParam "p" 0.3
sa :: State
sa = mkDoubleParam "alpha" 9.5
sb :: State
sb = mkDoubleParam "beta" 9.5
sx :: State
sx = mkIntData 1
dr :: Densi... | othercriteria/blaze | Bonawitz_3_7.hs | mit | 523 | 0 | 7 | 110 | 198 | 113 | 85 | 19 | 1 |
module Euler.Roman (
roman, unroman
) where
import Data.Word
roman :: Word64 -> String
roman 1000 = "M"
roman 900 = "CM"
roman 500 = "D"
roman 400 = "CD"
roman 100 = "C"
roman 90 = "XC"
roman 50 = "L"
roman 40 = "XL"
roman 10 = "X"
roman 9 = "IX"
roman 5 = "V"
roman 4 = "IV"
roman 1 = "I"
rom... | Undeterminant/euler-haskell | Euler/Roman.hs | cc0-1.0 | 1,521 | 2 | 9 | 548 | 850 | 421 | 429 | 47 | 1 |
import Control.Applicative
import Data.Unfoldable
import Data.Unfolder
import Data.Maybe
import System.Random
data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving Show
instance Unfoldable Tree where
unfold fa = choose
[ pure Empty
, Leaf <$> fa
, Node <$> unfold fa <*> fa <*> unfold fa
... | technogeeky/centered | include/unfoldable-0.5.0/examples/tree.hs | gpl-3.0 | 507 | 0 | 11 | 110 | 186 | 98 | 88 | 17 | 1 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, GeneralizedNewtypeDeriving, FlexibleContexts, TypeFamilies,BangPatterns,MultiParamTypeClasses, StandaloneDeriving, NoMonomorphismRestriction, TemplateHaskell, ViewPatterns, FlexibleInstances #-}
{-# OPTIONS -Wall -fno-warn-orphans #-}
module Tetrahedron.Triangle(
modu... | DanielSchuessler/hstri | Tetrahedron/Triangle.hs | gpl-3.0 | 17,303 | 0 | 13 | 3,310 | 4,340 | 2,352 | 1,988 | 373 | 7 |
module CppWriter (
render
) where
import ModuleParser (DataType(..), Param(..), ModuleDef(..))
import ListManip (strToLower, allButLast)
import Control.Monad.Writer (Writer, execWriter, tell)
import Control.Monad (mapM_, liftM)
type StringWriter = Writer String ()
-- | Wrap the Writer monad
render :: [ModuleDef]... | SneakingCat/proper-play-gen | src/CppWriter.hs | gpl-3.0 | 5,644 | 0 | 11 | 1,350 | 1,426 | 692 | 734 | 140 | 7 |
module TCPPingServer
( runServer
) where
import Network.Socket
import Control.Exception
import Control.Concurrent
runServer :: IO ()
runServer = do
sock <- socket AF_INET Stream 0
setSocketOption sock ReuseAddr 1
bindSocket sock $ SockAddrInet 4242 iNADDR_ANY
listen sock 2
serverLoop sock
serverL... | ConnorDillon/haskell-experiments | TCPPingServer.hs | gpl-3.0 | 871 | 0 | 15 | 295 | 285 | 133 | 152 | 31 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.