_id
stringlengths
64
64
repository
stringlengths
6
84
name
stringlengths
4
110
content
stringlengths
0
248k
license
null
download_url
stringlengths
89
454
language
stringclasses
7 values
comments
stringlengths
0
74.6k
code
stringlengths
0
248k
bf1e08719663c0214828ab6b872d5d61e444bec92eb3230f31e4f9681ba1379c
neongreen/haskell-ex
Main.hs
import Data.Char scary :: String -> Int scary = sum . map value where value x | isLetter x && isAscii x = ord (toUpper x) - (ord 'A' - 1) | otherwise = 0 isScary :: String -> Bool isScary xs = scary xs == 13 main :: IO () main = do contents <- readFile "/usr/share/dict/words" put...
null
https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week1/scary/alviprofluvium/Main.hs
haskell
import Data.Char scary :: String -> Int scary = sum . map value where value x | isLetter x && isAscii x = ord (toUpper x) - (ord 'A' - 1) | otherwise = 0 isScary :: String -> Bool isScary xs = scary xs == 13 main :: IO () main = do contents <- readFile "/usr/share/dict/words" put...
c4348366ef51150eab569961ad675bf9a5bbae88948d5ede0b1a3f9fae564666
Dasudian/DSDIN
dsdc_chain_state.erl
-module(dsdc_chain_state). -export([ find_common_ancestor/2 , get_hash_at_height/1 , hash_is_connected_to_genesis/1 , hash_is_in_main_chain/1 , insert_block/1 ]). %% For tests -export([ get_top_block_hash/1 , get_hash_at_height/2 ]). -include("blocks.hrl"). ...
null
https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdcore/src/dsdc_chain_state.erl
erlang
For tests =================================================================== API =================================================================== =================================================================== =================================================================== --------------------------------...
-module(dsdc_chain_state). -export([ find_common_ancestor/2 , get_hash_at_height/1 , hash_is_connected_to_genesis/1 , hash_is_in_main_chain/1 , insert_block/1 ]). -export([ get_top_block_hash/1 , get_hash_at_height/2 ]). -include("blocks.hrl"). -define(inte...
1ebb079e4722633afca81e2ba64c058fa994119296729ec1d3b157696f9598ec
DomainDrivenArchitecture/dda-cloudspec
cloudspec_test_runner.cljs
Copyright 2014 - 2018 meissa . All Rights Reserved . ;; 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 ;; ;; -2.0 ;; ;; Unless required by applicable law or agreed to in writing...
null
https://raw.githubusercontent.com/DomainDrivenArchitecture/dda-cloudspec/8197de8b5eb528fce14d71ec83298a38d282ab90/test/cljs/dda/cloudspec_test_runner.cljs
clojure
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing pe...
Copyright 2014 - 2018 meissa . All Rights Reserved . distributed under the License is distributed on an " AS - IS " BASIS , (ns dda.cloudspec-test-runner (:require [doo.runner :refer-macros [doo-tests]] [pjstadig.humane-test-output] [dda.template-test])) (doo-tests 'dda.template-test)
973f52d0052a2503a4d73c501b3f9b065ef8387910bf8b5839e53e876db7dc9d
cgrand/parsnip
asm.clj
(ns parsnip.asm) (defn- map-targets-drop-labels [f pgm] (vec (mapcat (fn [[op x]] (case op (:CALL :JUMP :FORK) [op (f x)] :LABEL nil [op x])) (partition 2 pgm)))) (defn link [pgm] (let [labels (reduce (fn [labels pc] ...
null
https://raw.githubusercontent.com/cgrand/parsnip/48ab030f2645b47d77f5f22d3a0c4d5dc4b3e688/src/parsnip/asm.clj
clojure
(ns parsnip.asm) (defn- map-targets-drop-labels [f pgm] (vec (mapcat (fn [[op x]] (case op (:CALL :JUMP :FORK) [op (f x)] :LABEL nil [op x])) (partition 2 pgm)))) (defn link [pgm] (let [labels (reduce (fn [labels pc] ...
a53a3bdb766a86c7deb0aa2bfcc155981722a06300bd4bdd259d6a927c50c09e
maoe/influxdb-haskell
Ping.hs
# LANGUAGE CPP # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # #if __GLASGOW_HASKELL__ >= 800 # OPTIONS_GHC -Wno - missing - signatures # #else # OPTIONS_GHC -fno - warn - missing - signatures # #endif module Database.InfluxDB.Ping * interface ping * parameters ...
null
https://raw.githubusercontent.com/maoe/influxdb-haskell/25c5d91e7d6e9643e0944df2896e1ad8d4c22b26/src/Database/InfluxDB/Ping.hs
haskell
# LANGUAGE OverloadedStrings # * Pong $setup | The full set of parameters for the ping API Following lenses are available to access its fields: * 'server' * 'manager' * 'timeout' ^ HTTP connection manager ^ Timeout Default parameters: ['server'] 'defaultServer' ['timeout'] 'Nothing' | >>> pingPara...
# LANGUAGE CPP # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # #if __GLASGOW_HASKELL__ >= 800 # OPTIONS_GHC -Wno - missing - signatures # #else # OPTIONS_GHC -fno - warn - missing - signatures # #endif module Database.InfluxDB.Ping * interface ping * parameters , PingParams , pingParams , s...
648b1b2f271db8b50b242a698d8b47b519c8a600de3a331779791de21485b5a7
emqx/emqx
emqx_delayed_api_SUITE.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . %% 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 o...
null
https://raw.githubusercontent.com/emqx/emqx/a26c05f4f6d332364aa4195818ee0d6d95dadbbe/apps/emqx_modules/test/emqx_delayed_api_SUITE.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or im...
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(emqx_delayed_api_SUITE). -compile(nowarn_export_all). -compile(export_all). -include_l...
182f6efe809ac07a0fea1babb273db2de13f7c4f949962fd2d5ef61e1891f98b
feeley/define-library
read.scm
(define-library (scheme read) (namespace "") (export read ))
null
https://raw.githubusercontent.com/feeley/define-library/56a6eda7ef9248751f4cada832edf98f5c6bb469/scheme/read/read.scm
scheme
(define-library (scheme read) (namespace "") (export read ))
fc667a94219d38f73124773289a2f8ad34128a5d5c3395a2ea715e8d448e4561
input-output-hk/cardano-addresses
DelegationSpec.hs
# LANGUAGE FlexibleContexts # module Command.Address.DelegationSpec ( spec ) where import Prelude import Test.Hspec ( Spec, SpecWith, it, shouldBe, shouldContain ) import Test.Utils ( cli, describeCmd ) spec :: Spec spec = describeCmd [ "address", "delegation" ] $ do specFromExtendedKey defaultP...
null
https://raw.githubusercontent.com/input-output-hk/cardano-addresses/d6dcd277d92c76e45d1024f7d82837fc0907aa12/command-line/test/Command/Address/DelegationSpec.hs
haskell
# LANGUAGE FlexibleContexts # module Command.Address.DelegationSpec ( spec ) where import Prelude import Test.Hspec ( Spec, SpecWith, it, shouldBe, shouldContain ) import Test.Utils ( cli, describeCmd ) spec :: Spec spec = describeCmd [ "address", "delegation" ] $ do specFromExtendedKey defaultP...
1c7a4b154ebec02d6652afe6ca4aca2d894866d513038992f7f2d8f8abdafc11
dimitri/pgloader
regress.lisp
;;; ;;; Regression tests driver. ;;; ;;; We're using SQL EXCEPT to compare what we loaded with what we expected ;;; to load. ;;; (in-package #:pgloader) (define-condition regression-test-error (error) ((filename :initarg :filename :reader regression-test-filename)) (:report (lambda (err stream) (form...
null
https://raw.githubusercontent.com/dimitri/pgloader/3047c9afe141763e9e7ec05b7f2a6aa97cf06801/src/regress/regress.lisp
lisp
Regression tests driver. We're using SQL EXCEPT to compare what we loaded with what we expected to load. now do our work once we are done running the load-file, compare the loaded data with our expected data file change target table-name schema The connection facility still works with cons here, rather tha...
(in-package #:pgloader) (define-condition regression-test-error (error) ((filename :initarg :filename :reader regression-test-filename)) (:report (lambda (err stream) (format stream "Regression test failed: ~s" (regression-test-filename err))))) (defun proce...
ee5ebc73024732011eb023786c2b9a3b61f80d6b7a98e51633908cf9d1d9993c
dyne/social-wallet-api
handler.clj
Social Wallet REST API Copyright ( C ) 2017- Dyne.org foundation designed , written and maintained by < > This file is part of Social Wallet REST API . Social Wallet REST API is free software ; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as publi...
null
https://raw.githubusercontent.com/dyne/social-wallet-api/72cc18989382297e1315a0ab4aac50b9882aa374/test/social_wallet_api/test/handler.clj
clojure
you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version . without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See th...
Social Wallet REST API Copyright ( C ) 2017- Dyne.org foundation designed , written and maintained by < > This file is part of Social Wallet REST API . You should have received a copy of the GNU Affero General Public License along with this program . If not , see < / > . Additional permission u...
70248e22eec073a592f9124621e133b7b2a27054c88968593261eca0816e955c
elaforge/karya
Z1.hs
Copyright 2013 -- This program is distributed under the terms of the GNU General Public -- License 3.0, see COPYING or -3.0.txt | Korg Z1 keyboard . module User.Elaforge.Instrument.Z1 where import qualified Data.Bits as Bits import Data.Bits ((.|.)) import qualified Data.ByteString as B import ...
null
https://raw.githubusercontent.com/elaforge/karya/de1b6e8cb0a17870801cc4dd49de8de62eb6c5fe/User/Elaforge/Instrument/Z1.hs
haskell
This program is distributed under the terms of the GNU General Public License 3.0, see COPYING or -3.0.txt Each patch has its own pb range, but you can override them in the multiset. The PE controls are the "performance expression" knobs whose effect depends on the instrument. Turn portamento on and off. Genera...
Copyright 2013 | Korg Z1 keyboard . module User.Elaforge.Instrument.Z1 where import qualified Data.Bits as Bits import Data.Bits ((.|.)) import qualified Data.ByteString as B import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as Char8 import qualified Data.Text as Text...
58f36855149aca06e2d5fa15edc4fcda29b847503a039adb7792cb6baaf3eccd
vmchale/shake-dhall
Dhall.hs
module Development.Shake.Dhall ( needDhall , needDhallCli , dhallDeps ) where import Control.Monad (filterM, (<=<)) import Control.Monad.IO.Class (liftIO) import Data.Containers.Lis...
null
https://raw.githubusercontent.com/vmchale/shake-dhall/3fa3cf72c2fe77c7e3985cf01bcc4f3f53a39666/src/Development/Shake/Dhall.hs
haskell
| 'need' some @.dhall@ files and imported dependencies | Same as 'needDhall' but shells out to the command-line executable @since 0.1.1.0 | Uses @dhall resolve --transitive-dependencies@ to work; command-line tool must be installed. @since 0.1.1.0
module Development.Shake.Dhall ( needDhall , needDhallCli , dhallDeps ) where import Control.Monad (filterM, (<=<)) import Control.Monad.IO.Class (liftIO) import Data.Containers.Lis...
6a97343e47673bfa78a0d8d546eab9a3e67c58a05f5f2d5c04ee4d86369787a5
wireapp/wire-server
User.hs
{-# LANGUAGE OverloadedStrings #-} -- This file is part of the Wire Server implementation. -- Copyright ( C ) 2022 Wire Swiss GmbH < > -- -- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundati...
null
https://raw.githubusercontent.com/wireapp/wire-server/2e1290d79e43685f5fecacd95b7170e3714ad848/libs/brig-types/src/Brig/Types/User.hs
haskell
# LANGUAGE OverloadedStrings # This file is part of the Wire Server implementation. This program is free software: you can redistribute it and/or modify it under later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANT...
Copyright ( C ) 2022 Wire Swiss GmbH < > the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any You should have received a copy of the GNU Affero General Public License along module Brig.Types.User ( Mana...
eaef69646bcf05ba809d39e66264923501164db12e203134e4c9f9da9e1ea402
mathematical-systems/clml
swank-loader.lisp
;;;; -*- indent-tabs-mode: nil -*- ;;; ;;; swank-loader.lisp --- Compile and load the Slime backend. ;;; Created 2003 , < > ;;; ;;; This code has been placed in the Public Domain. All warranties ;;; are disclaimed. ;;; ;; If you want customize the source- or fasl-directory you can set ;; swank-loader:*source-dir...
null
https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/addons/slime/swank-loader.lisp
lisp
-*- indent-tabs-mode: nil -*- swank-loader.lisp --- Compile and load the Slime backend. This code has been placed in the Public Domain. All warranties are disclaimed. If you want customize the source- or fasl-directory you can set swank-loader:*source-directory* resp. swank-loader:*fasl-directory* before lo...
Created 2003 , < > ( defparameter swank - loader::*fasl - directory * " /tmp / fasl/ " ) (cl:defpackage :swank-loader (:use :cl) (:export :init :dump-image :*source-directory* :*fasl-directory*)) (cl:in-package :swank-loader) (defvar *source-directory* (make-pathname ...
9a0bcdcb95f5a5d2b4041853b1167bdffcebbd38a1521a83663781a3dfa901f7
rowangithub/DOrder
a_init.ml
let rec init (i:int) (n:int) (x:int) (a:int array) = if (i >= n) then () else (let _ = Array.set a i x in init (i+1) n x a) let main l = let n = Array.length l in init 0 n 1 l let vec = [|0;0;0|] let _ = main vec
null
https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/array/a_init.ml
ocaml
let rec init (i:int) (n:int) (x:int) (a:int array) = if (i >= n) then () else (let _ = Array.set a i x in init (i+1) n x a) let main l = let n = Array.length l in init 0 n 1 l let vec = [|0;0;0|] let _ = main vec
400dca31c93a6f3986be4f27b98fe221e9aba1ee4927de3dd92734b38a43a0b1
rickardlindberg/brainfuck
Brainfuck.hs
module Brainfuck where import qualified Data.Map as M import Data.Maybe import Data.Char data Op = MLeft | MRight | Inc | Dec | In | Out deriving (Show, Eq) type Program = [Op] type Input = [Int] type Output = [Int] type Position = Int type Tape = M.Map Int Int data Machin...
null
https://raw.githubusercontent.com/rickardlindberg/brainfuck/fa4940f131adb3682b892f05bb5debef9576b27d/versions/raek_levsa/Brainfuck.hs
haskell
module Brainfuck where import qualified Data.Map as M import Data.Maybe import Data.Char data Op = MLeft | MRight | Inc | Dec | In | Out deriving (Show, Eq) type Program = [Op] type Input = [Int] type Output = [Int] type Position = Int type Tape = M.Map Int Int data Machin...
4e0078934519509eb4256f56b0338073e88d69b093ba2fb5d0f8ed3b6739106e
rainbyte/frag
Command.hs
$ I d : Command.hs , v 1.2 2003/11/10 21:28:58 antony Exp $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * I N V A D E R S * * * * Module : Command ...
null
https://raw.githubusercontent.com/rainbyte/frag/28893048f093f369c896932ff297150ef8ed2dd0/src/Command.hs
haskell
Quit Invaders. Play game. Freeze game. Resume game. | CmdUp -- Move Up. | CmdDown -- Move Down. | CmdLeft -- Move Left. Move Right .
$ I d : Command.hs , v 1.2 2003/11/10 21:28:58 antony Exp $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * I N V A D E R S * * * * Module : Command ...
21bf5b59abaa89e64267a6a037715cbde0badb47e53de29f8ca39f86f2eed266
slipstream/SlipStreamServer
authn_info_header_test.clj
(ns com.sixsq.slipstream.ssclj.middleware.authn-info-header-test (:require [clojure.test :refer :all] [com.sixsq.slipstream.auth.cookies :as cookies] [com.sixsq.slipstream.ssclj.middleware.authn-info-header :refer :all] [ring.util.codec :as codec])) (defn serialize-cookie-value "replaces the map co...
null
https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi/test/com/sixsq/slipstream/ssclj/middleware/authn_info_header_test.clj
clojure
(ns com.sixsq.slipstream.ssclj.middleware.authn-info-header-test (:require [clojure.test :refer :all] [com.sixsq.slipstream.auth.cookies :as cookies] [com.sixsq.slipstream.ssclj.middleware.authn-info-header :refer :all] [ring.util.codec :as codec])) (defn serialize-cookie-value "replaces the map co...
322cfa1c333a35fb159d6a2a432900b94c9e86e1583f35de21a7d2c357963178
bos/rwh
actions2.hs
{-- snippet all --} str2message :: String -> String str2message input = "Data: " ++ input str2action :: String -> IO () str2action = putStrLn . str2message numbers :: [Int] numbers = [1..10] main = do str2action "Start of the program" mapM_ (str2action . show) numbers str2action "Done!" {-- /snip...
null
https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch07/actions2.hs
haskell
- snippet all - - /snippet all -
str2message :: String -> String str2message input = "Data: " ++ input str2action :: String -> IO () str2action = putStrLn . str2message numbers :: [Int] numbers = [1..10] main = do str2action "Start of the program" mapM_ (str2action . show) numbers str2action "Done!"
8a700856e2ad59fef06fc04b9daa8c47b6c115f5095b3c5bd9f94db7800dc922
reiddraper/sumo
client.clj
(ns sumo.test.client (:require [sumo.client :as client] [sumo.mr-helpers :as mr-helpers]) (:use midje.sweet )) (def c (client/connect)) (fact "can ping the client" (client/ping c) => true) (fact "get of non-existant key returns empty result" (client/get c "does-not-exist" "does-not-exist") => []...
null
https://raw.githubusercontent.com/reiddraper/sumo/bd330f14483bfdc7ccb9dbdc3f60266b8e1d95f4/test/sumo/test/client.clj
clojure
(ns sumo.test.client (:require [sumo.client :as client] [sumo.mr-helpers :as mr-helpers]) (:use midje.sweet )) (def c (client/connect)) (fact "can ping the client" (client/ping c) => true) (fact "get of non-existant key returns empty result" (client/get c "does-not-exist" "does-not-exist") => []...
10e36411a9ca3c295f773541eb09532d6aeb04918b530031e27d7bb31daa4ee5
pariyatti/kosa
db.clj
(ns kosa.mobile.today.stacked-inspiration.db (:refer-clojure :exclude [list get]) (:require [kuti.record :as record] [kuti.record.query :as query] [kuti.storage.nested :refer [expand-all]] [kuti.record.nested :as nested])) (defn list [] (map expand-all (record/list :stacked-in...
null
https://raw.githubusercontent.com/pariyatti/kosa/42bbbae367d3ee4e028bdb812c2def1181228c93/src/kosa/mobile/today/stacked_inspiration/db.clj
clojure
(ns kosa.mobile.today.stacked-inspiration.db (:refer-clojure :exclude [list get]) (:require [kuti.record :as record] [kuti.record.query :as query] [kuti.storage.nested :refer [expand-all]] [kuti.record.nested :as nested])) (defn list [] (map expand-all (record/list :stacked-in...
01a2e51d87a23d1ec1207c995dd9a452c7d2517bfd94eb9917c22d9be8570cce
pa-ba/compdata-param
SmartConstructors.hs
# LANGUAGE TemplateHaskell , CPP # -------------------------------------------------------------------------------- -- | Module : Data . Comp . . Multi . Derive . SmartConstructors Copyright : ( c ) 2011 , -- License : BSD3 Maintainer : < > -- Stability : experimental Portabilit...
null
https://raw.githubusercontent.com/pa-ba/compdata-param/5d6b0afa95a27fd3233f86e5efc6e6a6080f4236/src/Data/Comp/Param/Multi/Derive/SmartConstructors.hs
haskell
------------------------------------------------------------------------------ | License : BSD3 Stability : experimental Automatically derive smart constructors for higher-order difunctors. ------------------------------------------------------------------------------
# LANGUAGE TemplateHaskell , CPP # Module : Data . Comp . . Multi . Derive . SmartConstructors Copyright : ( c ) 2011 , Maintainer : < > Portability : non - portable ( GHC Extensions ) module Data.Comp.Param.Multi.Derive.SmartConstructors ( smartConstructors ) where im...
701ccac331a32ab0585735a98ae808757ee117970092cdf477c0fc8eb6ca2ad8
flavioc/cl-hurd
msg-server.lisp
(in-package :mach) (defcfun ("mach_msg_server_timeout" %mach-msg-server-timeout) err (demuxer :pointer) (max-size msg-size) (port-set port) (options msg-option) (timeout msg-timeout)) (defmacro msg-server-timeout (demuxer port-set &optional timeout max-size) "Receive RPC request messages on port-set an...
null
https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/mach/msg-server.lisp
lisp
(in-package :mach) (defcfun ("mach_msg_server_timeout" %mach-msg-server-timeout) err (demuxer :pointer) (max-size msg-size) (port-set port) (options msg-option) (timeout msg-timeout)) (defmacro msg-server-timeout (demuxer port-set &optional timeout max-size) "Receive RPC request messages on port-set an...
583f566fa165f8dd29b9a9c139bcb873ed955a541bff6fe5717d895dd841f017
typelead/eta
GivenTypeSynonym.hs
# LANGUAGE TypeFamilies # module Main where data A a type T a = A a f :: (A a ~ T Int) => a -> Int f x = x main :: IO () main = return ()
null
https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/GivenTypeSynonym.hs
haskell
# LANGUAGE TypeFamilies # module Main where data A a type T a = A a f :: (A a ~ T Int) => a -> Int f x = x main :: IO () main = return ()
6c349ef336a5732bea3c0e097cb8a6ab3e392d2cdf718e46f1fc81685fab80d4
deadcode/Learning-CL--David-Touretzky
8.29.lisp
(defun my-member (e x) (cond ((null x) nil) ((equal e (first x)) x) (t (my-member e (rest x))))) (let ((test1 '(my-member 'c '(a b c d e f))) (test2 '(my-member 'f '(a b c d e f))) (test3 '(my-member 'g '(a b c d e f))) (test4 '(my-member 'g '()))) (format t "~s = ~s~%" t...
null
https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%208/8.29.lisp
lisp
(defun my-member (e x) (cond ((null x) nil) ((equal e (first x)) x) (t (my-member e (rest x))))) (let ((test1 '(my-member 'c '(a b c d e f))) (test2 '(my-member 'f '(a b c d e f))) (test3 '(my-member 'g '(a b c d e f))) (test4 '(my-member 'g '()))) (format t "~s = ~s~%" t...
a2c550311159e23b4b5244b172288f57f67b36fda3812ac0b2d52086ad834e59
larcenists/larceny
cpstak.scm
CPSTAK -- A continuation - passing version of the TAK benchmark . A good test of first class procedures and tail recursion . (define (cpstak x y z) (define (tak x y z k) (if (not (< y x)) (k z) (tak (- x 1) y z (lambda (v1) (tak (- y 1) ...
null
https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Stress/src/cpstak.scm
scheme
CPSTAK -- A continuation - passing version of the TAK benchmark . A good test of first class procedures and tail recursion . (define (cpstak x y z) (define (tak x y z k) (if (not (< y x)) (k z) (tak (- x 1) y z (lambda (v1) (tak (- y 1) ...
40051250a2d34941505967f3abe953b85a22ef6287f68724c97c4df832b0f1fd
freckle/stackctl
Options.hs
module Stackctl.Options ( Options , envParser , optionsParser ) where import Stackctl.Prelude import Data.Semigroup.Generic import qualified Env import Options.Applicative import Stackctl.ColorOption import Stackctl.DirectoryOption import Stackctl.FilterOption import Stackctl.VerboseOption data Options = Opt...
null
https://raw.githubusercontent.com/freckle/stackctl/b04e1790dc523cea39e07c868b4fa328f4e453cb/src/Stackctl/Options.hs
haskell
brittany-disable-next-binding brittany-disable-next-binding
module Stackctl.Options ( Options , envParser , optionsParser ) where import Stackctl.Prelude import Data.Semigroup.Generic import qualified Env import Options.Applicative import Stackctl.ColorOption import Stackctl.DirectoryOption import Stackctl.FilterOption import Stackctl.VerboseOption data Options = Opt...
224b8818826822037085b3a7ec0c8a14bd603f3e48150cd9fa6684f14635a3fb
mrkgnao/pebble
Simplify.hs
module Simplify where import Data.List import Data.Maybe import Expr import qualified Functions as F -- | Cleans up nonsense like X :^ X :* (X :* ((Const 1.0 :/ X) :* Const 1.0) :+ -- | Const 1.0 :* Apply "log" X) into (hopefully) nicer expressions like -- | X :^ X ((Const 1.0) :+ Apply "log" X), simplify :: Expr -...
null
https://raw.githubusercontent.com/mrkgnao/pebble/b6f9e8220f76b1f07f419e6815e946328afb9244/Simplify.hs
haskell
| Cleans up nonsense like X :^ X :* (X :* ((Const 1.0 :/ X) :* Const 1.0) :+ | Const 1.0 :* Apply "log" X) into (hopefully) nicer expressions like | X :^ X ((Const 1.0) :+ Apply "log" X), | Multiplication m * (n * f) = (m * n) * f mfn = mnf fmn = mnf m(f+g) = mf+mg | Trigonometric inverses placeholder
module Simplify where import Data.List import Data.Maybe import Expr import qualified Functions as F simplify :: Expr -> Expr simplify (Const a :+ Const b) = Const (a + b) simplify (a :+ Const 0) = simplify a simplify (Const 0 :+ a) = simplify a simplify (Const a :* Const b) = Const (a * b) simplify (a :* Const 1)...
aa6748e8c9b78cce6ca3a8558c680678e52d87bdc1046520f77b1f7fa8833d27
tek/ribosome
Main.hs
module Main where import Polysemy.Test (unitTest) import Ribosome.Menu.Test.FilterTest (test_filterFuzzy) import Ribosome.Menu.Test.MenuTest (test_menu) import Ribosome.Menu.Test.NvimMenuTest (test_nvimMenu) import Test.Tasty (TestTree, defaultMain, testGroup) tests :: TestTree tests = testGroup "menu" [ test_m...
null
https://raw.githubusercontent.com/tek/ribosome/ec3dd63ad47322e7fec66043dd7e6ade2f547ac1/packages/menu/test/Main.hs
haskell
module Main where import Polysemy.Test (unitTest) import Ribosome.Menu.Test.FilterTest (test_filterFuzzy) import Ribosome.Menu.Test.MenuTest (test_menu) import Ribosome.Menu.Test.NvimMenuTest (test_nvimMenu) import Test.Tasty (TestTree, defaultMain, testGroup) tests :: TestTree tests = testGroup "menu" [ test_m...
8ffbf9ecd567c7023a384b906f840773a3bcb89c4a371c3f24dedeab8a129ea3
shonfeder/um-abt
abt.ml
Copyright ( c ) 2021 Shon Feder Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights to use , copy , modify , ...
null
https://raw.githubusercontent.com/shonfeder/um-abt/2b3860b8f9217b04e7cb0645ede7726988c3735b/lib/abt.ml
ocaml
* An operator A private table of the number of times a name has been bound * Just the string component of the name * Representation of name that includes the unique id Physical equality of references Free vars are greater than bound vars Adds auxiliary functions over an operator module * [same o o'] is [true]...
Copyright ( c ) 2021 Shon Feder Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights to use , copy , modify , ...
07b4756710f1148df7a985ed5f875858860defa6490acf30d3391072e96d3320
chenyukang/eopl
checker.scm
(module checker (lib "eopl.ss" "eopl") (require "drscheme-init.scm") (require "lang.scm") (require "static-classes.scm") (require "static-data-structures.scm") (provide type-to-external-form type-of type-of-program) ;; type-of-program : Program -> Type Page : 358 (define type-of-program (lambda (...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter9/typed-oo/checker.scm
scheme
type-of-program : Program -> Type type-of : Exp -> Tenv these tests either succeed or raise an error !! object stuff begins here check the call to initialize and return the class name as a type this matches interp.scm: interp.scm calls object->class-name, which fails on a non-object, so we need to make sure ...
(module checker (lib "eopl.ss" "eopl") (require "drscheme-init.scm") (require "lang.scm") (require "static-classes.scm") (require "static-data-structures.scm") (provide type-to-external-form type-of type-of-program) Page : 358 (define type-of-program (lambda (pgm) (cases program pgm (...
3c24de386ca3838aa49acd19abd02f0788474706ed20ad41e9baee26b53ec4ce
waddlaw/TAPL
Parser.hs
module Language.SystemF.Parser (runSystemFParser) where -- λs:Bool.λz:Bool.s (s z) λf : Bool.(λx : Bool.f ( λy : . ( x x ) y ) ) ( λx : Bool . f ( λy : . ( x x ) y ) ) -- import qualified RIO.Map as Map import Control.Monad.Trans.State import Language.Core.Parser hiding (Parser, symbol) import...
null
https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/subs/systemf/src/Language/SystemF/Parser.hs
haskell
λs:Bool.λz:Bool.s (s z) import qualified RIO.Map as Map lefty <$> evalStateT factorP env <*> evalStateT termsP env <|> varP <*> some digit varP :: StateT Context Parser Term varP = do ctx <- get where toTerm x xs = Text.pack (x : xs) FIXME : prelude
module Language.SystemF.Parser (runSystemFParser) where λf : Bool.(λx : Bool.f ( λy : . ( x x ) y ) ) ( λx : Bool . f ( λy : . ( x x ) y ) ) import Control.Monad.Trans.State import Language.Core.Parser hiding (Parser, symbol) import Language.SystemF.Types import RIO hiding (try) import qualified RIO.List.Partial ...
4fbaf4d0335c54971b05d3a0835308bebbdb39fcbaf432c610c252d546b0446a
substratic/engine-for-gambit
node.test.scm
Copyright ( c ) 2020 by , All Rights Reserved . Substratic Engine - ;; 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 /. (import (_test) (substratic engine node) (substra...
null
https://raw.githubusercontent.com/substratic/engine-for-gambit/b19fccfaa0e27ccec915597897eef24e8fcaa81e/node.test.scm
scheme
Copyright ( c ) 2020 by , All Rights Reserved . Substratic Engine - 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 /. (import (_test) (substratic engine node) (substratic...
5a6bce86a343611b6dcc634a8040e218efd6d68e08863ac7b18e3010fbb56938
ocaml-multicore/tezos
test_storage.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2020 Metastate AG < > (* ...
null
https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/test/test_storage.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2020 Metastate AG < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER I...
9593221c7dd2f3736249fb81c260d8de760a574b098e8b267c2451865cc09f89
Workiva/eva
integration_test.clj
Copyright 2015 - 2019 Workiva Inc. ;; ;; Licensed under the Eclipse Public License 1.0 (the "License"); ;; you may not use this file except in compliance with the License. ;; You may obtain a copy of the License at ;; ;; -1.0.php ;; ;; Unless required by applicable law or agreed to in writing, software dist...
null
https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/test/eva/v2/system/integration_test.clj
clojure
Licensed under the Eclipse Public License 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at -1.0.php Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre...
Copyright 2015 - 2019 Workiva Inc. distributed under the License is distributed on an " AS IS " BASIS , (ns eva.v2.system.integration-test (:require [clojure.test :refer :all] [eva.api :refer :all] [barometer.core :as m] [eva.v2.messaging.address :as address] [eva....
a2195abded5cc2ce7b461e2b9c26a55db35e79e3908787cdf8bc68c50828a0d0
utahstreetlabs/risingtide
feed_bolts.clj
(ns risingtide.storm.feed-bolts (:require [risingtide [core :refer [log-err]] [dedupe :refer [dedupe]] [key :as key] [config :as config] [redis :as redis] [active-users :refer [active-users active?]]] [risingtide.feed ...
null
https://raw.githubusercontent.com/utahstreetlabs/risingtide/bc5b798396679739469b1bd8ee1b03db76178cde/src/risingtide/storm/feed_bolts.clj
clojure
(ns risingtide.storm.feed-bolts (:require [risingtide [core :refer [log-err]] [dedupe :refer [dedupe]] [key :as key] [config :as config] [redis :as redis] [active-users :refer [active-users active?]]] [risingtide.feed ...
6f8520a9999acc77b50354198586926f3a3f581ad9cdbdca900e0e5cc6f63f00
theodormoroianu/SecondYearCourses
LambdaChurch_20210415165644.hs
module LambdaChurch where import Data.Char (isLetter) import Data.List ( nub ) class ShowNice a where showNice :: a -> String class ReadNice a where readNice :: String -> (a, String) data Variable = Variable { name :: String , count :: Int } deriving (Show, Eq, Ord) var :: String -> Variable var ...
null
https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415165644.hs
haskell
alpha-equivalence subst u x t defines [u/x]t, i.e., substituting u for x in t This substitution avoids variable captures so it is safe to be used when reducing terms with free variables (e.g., if evaluating inside lambda abstractions) ^ substitution term ^ variable to be substitutes ^ term in which the substit...
module LambdaChurch where import Data.Char (isLetter) import Data.List ( nub ) class ShowNice a where showNice :: a -> String class ReadNice a where readNice :: String -> (a, String) data Variable = Variable { name :: String , count :: Int } deriving (Show, Eq, Ord) var :: String -> Variable var ...
703ff6277462e9dcb66de3eb645087571ba3c56760ce6189a72e74955f7ba6ef
mauricioszabo/check
mocks.clj
(ns check.mocks (:require [clojure.spec.alpha :as s])) (s/def ::arrow '#{=> =streams=>}) (s/def ::template (s/cat :fn symbol? :args (s/* any?))) (s/def ::mocks (s/cat :mocks (s/+ (s/cat :template (s/spec ::template) :arrow ::arrow :return any?)) :arrow '#{--- ===} :bod...
null
https://raw.githubusercontent.com/mauricioszabo/check/fc4a3a619a8ce63d152f940de12bc96b83a4adfd/src/check/mocks.clj
clojure
(into {})))
(ns check.mocks (:require [clojure.spec.alpha :as s])) (s/def ::arrow '#{=> =streams=>}) (s/def ::template (s/cat :fn symbol? :args (s/* any?))) (s/def ::mocks (s/cat :mocks (s/+ (s/cat :template (s/spec ::template) :arrow ::arrow :return any?)) :arrow '#{--- ===} :bod...
64384e83c74a1fdb243d13643568d23db7831f3d30a8f5a4f718316d0d9d719e
racket/redex
rbtrees-3.rkt
#lang racket/base (require redex/benchmark "util.rkt" redex/reduction-semantics) (provide (all-defined-out)) (define the-error "doesn't increment black depth in non-empty case") (define-rewrite bug3 (rbt (B (c_1 t_11 n_1 t_12) n (c_2 t_21 n_2 t_22)) n_1min n_2max (s n_bd)) ==> (rbt (B (c_1 t...
null
https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-benchmark/redex/benchmark/models/rbtrees/rbtrees-3.rkt
racket
#lang racket/base (require redex/benchmark "util.rkt" redex/reduction-semantics) (provide (all-defined-out)) (define the-error "doesn't increment black depth in non-empty case") (define-rewrite bug3 (rbt (B (c_1 t_11 n_1 t_12) n (c_2 t_21 n_2 t_22)) n_1min n_2max (s n_bd)) ==> (rbt (B (c_1 t...
65d668545c052c7308b721218c9c4b86fe29a395f75248778280160d07abb0fb
mbenke/jnp3-haskell
TestLens3.hs
module Main where import Atom import Lens3 moveAtom :: Atom -> Atom moveAtom = over (point `comp` x) (+1) atom2 = moveAtom atom0 main = mapM_ print [atom0, atom1, atom2]
null
https://raw.githubusercontent.com/mbenke/jnp3-haskell/712c5a6a24ad0efb45aee2b48e66bb91d949848e/Code/lens/TestLens3.hs
haskell
module Main where import Atom import Lens3 moveAtom :: Atom -> Atom moveAtom = over (point `comp` x) (+1) atom2 = moveAtom atom0 main = mapM_ print [atom0, atom1, atom2]
33db562b25ca6ef0cb5a5d7dc85f4f0b62027be2c1e80554174bc388e862d0c4
grin-compiler/ghc-wpc-sample-programs
Context.hs
# LANGUAGE MultiParamTypeClasses , FlexibleInstances , FlexibleContexts , TypeSynonymInstances # # OPTIONS_GHC -fno - warn - orphans # | Module : Text . Regex . Base . Context Copyright : ( c ) 2006 SPDX - License - Identifier : BSD-3 - Clause Maintainer : Stability : experimental ...
null
https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/regex-base-0.94.0.0/src/Text/Regex/Base/Context.hs
haskell
| 0 based index from start of source , or ( -1 ) for unused | non - negative length of a match | 0 based index from start of source, or (-1) for unused | non-negative length of a match see 'regexFailed' Get the ByteString type for mood / doom Get the Regex types for the mood / doom workaround Get the RegexL...
# LANGUAGE MultiParamTypeClasses , FlexibleInstances , FlexibleContexts , TypeSynonymInstances # # OPTIONS_GHC -fno - warn - orphans # | Module : Text . Regex . Base . Context Copyright : ( c ) 2006 SPDX - License - Identifier : BSD-3 - Clause Maintainer : Stability : experimental ...
2145c8108ee798fcf93be95035524b89d31f4d4f87740f15ccc7889a9a1012a8
matsen/pplacer
rppr_info.ml
open Subcommand open Guppy_cmdobjs open Ppatteries open Convex class cmd () = object (self) inherit subcommand () as super inherit refpkg_cmd ~required:true as super_refpkg inherit tabular_cmd () as super_tabular val taxonomic = flag "--taxonomic" (Plain (false, "Show by-rank taxonomic information")) m...
null
https://raw.githubusercontent.com/matsen/pplacer/f40a363e962cca7131f1f2d372262e0081ff1190/pplacer_src/rppr_info.ml
ocaml
open Subcommand open Guppy_cmdobjs open Ppatteries open Convex class cmd () = object (self) inherit subcommand () as super inherit refpkg_cmd ~required:true as super_refpkg inherit tabular_cmd () as super_tabular val taxonomic = flag "--taxonomic" (Plain (false, "Show by-rank taxonomic information")) m...
02ecccb95e320ae0772bf0a9b31ec0e7bd7317dab742c8387d755f16233c7241
mirage/capnp-rpc
rO_array.ml
type 'a t = 'a array let init = Array.init let of_list = Array.of_list let get_exn t i = t.(i) let length = Array.length let map = Array.map let mapi = Array.mapi let iter = Array.iter let iteri = Array.iteri let fold_left = Array.fold_left let get ~oob t i = if i < 0 || i >= Array.length t then oob else Array.ge...
null
https://raw.githubusercontent.com/mirage/capnp-rpc/f04fa96a583994b71731bc1288833f8304c9ce81/capnp-rpc/rO_array.ml
ocaml
type 'a t = 'a array let init = Array.init let of_list = Array.of_list let get_exn t i = t.(i) let length = Array.length let map = Array.map let mapi = Array.mapi let iter = Array.iter let iteri = Array.iteri let fold_left = Array.fold_left let get ~oob t i = if i < 0 || i >= Array.length t then oob else Array.ge...
7df04b2e78a6aeb95d80f25cea8105ed4ff86486db90b0246ca7499eddee85d0
Javran/advent-of-code
Day19.hs
module Javran.AdventOfCode.Y2016.Day19 ( ) where import Data.Bits import Data.List import Javran.AdventOfCode.Prelude data Day19 deriving (Generic) -- safePosition :: Int -> Int safePosition n = 2 * l + 1 where l = clearBit n (finiteBitSize @Int unreachable - countLeadingZeros n - 1) solve2 :: Int -> Int s...
null
https://raw.githubusercontent.com/Javran/advent-of-code/676ef13c2f9d341cf7de0f383335a1cf577bd73d/src/Javran/AdventOfCode/Y2016/Day19.hs
haskell
module Javran.AdventOfCode.Y2016.Day19 ( ) where import Data.Bits import Data.List import Javran.AdventOfCode.Prelude data Day19 deriving (Generic) safePosition :: Int -> Int safePosition n = 2 * l + 1 where l = clearBit n (finiteBitSize @Int unreachable - countLeadingZeros n - 1) solve2 :: Int -> Int solve...
03695f410b0c4ec35160f56c2ff4e678efd60e94386399d4e50ed5418c0d5d4a
fetburner/Coq2SML
omega.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/plugins/omega/omega.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** ************************************...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Omega : a solver of quantifi...
b3ae0c32bd5add2c41bc86eda84e1cd707d40de64cdc9c7eeeba6e060ffafffc
cedlemo/OCaml-GI-ctypes-bindings-generator
File_filter_flags.ml
open Ctypes open Foreign type t = Filename | Uri | Display_name | Mime_type type t_list = t list let of_value v = if v = Unsigned.UInt32.of_int 1 then Filename else if v = Unsigned.UInt32.of_int 2 then Uri else if v = Unsigned.UInt32.of_int 4 then Display_name else if v = Unsigned.UInt32.of_int 8 then Mime_ty...
null
https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/File_filter_flags.ml
ocaml
open Ctypes open Foreign type t = Filename | Uri | Display_name | Mime_type type t_list = t list let of_value v = if v = Unsigned.UInt32.of_int 1 then Filename else if v = Unsigned.UInt32.of_int 2 then Uri else if v = Unsigned.UInt32.of_int 4 then Display_name else if v = Unsigned.UInt32.of_int 8 then Mime_ty...
881e6dfcc147d40e65b7f4f68a093abfc6394127099b673c126f7ede2f93ef31
andrewthad/sockets
Hybrid.hs
# language BangPatterns # # language DataKinds # # language MagicHash # module Socket.Stream.Uninterruptible.Hybrid ( sendMutableBytesUnmanagedBytes ) where import Data.Bytes.Types (MutableBytes,UnmanagedBytes) import GHC.Exts (RealWorld,proxy#) import Socket (Interruptibility(Uninterruptible)) import Socket.Stre...
null
https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/src/Socket/Stream/Uninterruptible/Hybrid.hs
haskell
^ Connection
# language BangPatterns # # language DataKinds # # language MagicHash # module Socket.Stream.Uninterruptible.Hybrid ( sendMutableBytesUnmanagedBytes ) where import Data.Bytes.Types (MutableBytes,UnmanagedBytes) import GHC.Exts (RealWorld,proxy#) import Socket (Interruptibility(Uninterruptible)) import Socket.Stre...
a9e6b4c190886cbf7aceb0bf825309618f47d595c8823fca6d6ca0ae5a4416a4
elnewfie/lslforge
XmlCreate.hs
module Language.Lsl.Internal.XmlCreate(emit,emitSimple,xmlEscape,emitList) where emit :: String -> [(String,String)] -> [(String -> String)] -> String -> String emit name attrs body = showString "<" . showString name . foldl (.) (id) (map (\ (n,v) -> showString " " . showString n . showString "=" . shows v) at...
null
https://raw.githubusercontent.com/elnewfie/lslforge/27eb84231c53fffba6bdb0db67bde81c1c12dbb9/lslforge/haskell/src/Language/Lsl/Internal/XmlCreate.hs
haskell
module Language.Lsl.Internal.XmlCreate(emit,emitSimple,xmlEscape,emitList) where emit :: String -> [(String,String)] -> [(String -> String)] -> String -> String emit name attrs body = showString "<" . showString name . foldl (.) (id) (map (\ (n,v) -> showString " " . showString n . showString "=" . shows v) at...
66b5df5c0787b7c99e5ae6902d0da235e0e5d35208a3d2c1fc373eb32250c112
eval/deps-try
sexp.clj
(ns rebel-readline.clojure.sexp (:require [clojure.string :as string] [rebel-readline.clojure.tokenizer :as tokenize]) (:import [java.util.regex Pattern])) (defn position-in-range? [s pos] (<= 0 pos (dec (count s)))) (defn blank-at-position? [s pos] (or (not (position-in-range? s pos)) (Charact...
null
https://raw.githubusercontent.com/eval/deps-try/da691c68b527ad5f9e770dbad82cce6cbbe16fb4/vendor/rebel-readline/rebel-readline/src/rebel_readline/clojure/sexp.clj
clojure
position of insertion not before found closing bracket of wrong type unbalanced TODO :character should not be in in-quote?
(ns rebel-readline.clojure.sexp (:require [clojure.string :as string] [rebel-readline.clojure.tokenizer :as tokenize]) (:import [java.util.regex Pattern])) (defn position-in-range? [s pos] (<= 0 pos (dec (count s)))) (defn blank-at-position? [s pos] (or (not (position-in-range? s pos)) (Charact...
1fb4ee0dfc1971b1b2b84890ec3d83e177d33e5cf7b9cc276aaa181a7e8ca371
metosin/vega-tools
expr_test.cljs
(ns vega-tools.expr-test (:require [cljs.test :refer-macros [deftest is testing]] [vega-tools.expr :refer [compile-expr] :refer-macros [expr]])) (deftest test-compile-expr (testing "Primitive expressions" (is (= (compile-expr :datum) "datum")) (is (= (compile-expr {}) "{}")) (is (= (compile...
null
https://raw.githubusercontent.com/metosin/vega-tools/9530b7514fc24ba3b918d69d78c6ab31971e91d7/test/cljs/vega_tools/expr_test.cljs
clojure
(ns vega-tools.expr-test (:require [cljs.test :refer-macros [deftest is testing]] [vega-tools.expr :refer [compile-expr] :refer-macros [expr]])) (deftest test-compile-expr (testing "Primitive expressions" (is (= (compile-expr :datum) "datum")) (is (= (compile-expr {}) "{}")) (is (= (compile...
06333643b735cd61148b60f2c947585dec1ca56c9eb88be373500cf868fdf56f
emotiq/emotiq
genesis.lisp
(in-package :emotiq-config-generate-test) (defun create-genesis-block () (let ((d (emotiq/filesystem:new-temporary-directory))) (let* ((nodes (emotiq/config/generate::generate-keys emotiq/config/generate::*eg-config-zerotier*)) (stakes (emotiq/config/generate::gen...
null
https://raw.githubusercontent.com/emotiq/emotiq/9af78023f670777895a3dac29a2bbe98e19b6249/src/test/genesis.lisp
lisp
(in-package :emotiq-config-generate-test) (defun create-genesis-block () (let ((d (emotiq/filesystem:new-temporary-directory))) (let* ((nodes (emotiq/config/generate::generate-keys emotiq/config/generate::*eg-config-zerotier*)) (stakes (emotiq/config/generate::gen...
42adb5c7aa50a8a1be74b228515b2b97451560ff07592a4fe095c66d39c3da57
liebke/avout
atom.clj
(ns avout.sdb.atom (:use avout.state) (:require [simpledb.core :as sdb] [avout.atoms :as atoms]) (:import clojure.lang.IRef)) (deftype SDBStateContainer [client domainName name] StateContainer (initStateContainer [this] (when-not (seq (sdb/get-attributes client domainName name)) (sdb/...
null
https://raw.githubusercontent.com/liebke/avout/06f3e00d63f487ebd01581343302e96b915f5b03/experimental/orolo/plugins/avout-sdb/src/avout/sdb/atom.clj
clojure
(ns avout.sdb.atom (:use avout.state) (:require [simpledb.core :as sdb] [avout.atoms :as atoms]) (:import clojure.lang.IRef)) (deftype SDBStateContainer [client domainName name] StateContainer (initStateContainer [this] (when-not (seq (sdb/get-attributes client domainName name)) (sdb/...
288eb7a72e5a7d89f2fe8ed3aa5cfbd394d43c5a737464a45c670f548e44c925
SamB/coq
showproof.ml
# use " /cygdrive / D / Tools / coq-7avril / dev / base_include " ; ; open Coqast ; ; #use "/cygdrive/D/Tools/coq-7avril/dev/base_include";; open Coqast;; *) open Environ open Evd open Names open Nameops open Libnames open Term open Termops open Util open Proof_type open Pfedit open Translate open Term open Reduc...
null
https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/contrib/interface/showproof.ml
ocaml
*************************************************************************** hypotheses type complet avec les hypotheses. let long_type_hyp x y = y;; Expansion des tactikelles Differences entre signatures recupere l'arbre de preuve courant. *************************************************************...
# use " /cygdrive / D / Tools / coq-7avril / dev / base_include " ; ; open Coqast ; ; #use "/cygdrive/D/Tools/coq-7avril/dev/base_include";; open Coqast;; *) open Environ open Evd open Names open Nameops open Libnames open Term open Termops open Util open Proof_type open Pfedit open Translate open Term open Reduc...
4bfec827444f939f677d7a1b07b06bfbb536be13df4b608635d77017c134c76f
rvantonder/hack_parallel
daemon.mli
* * Copyright ( c ) 2015 , 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 . *...
null
https://raw.githubusercontent.com/rvantonder/hack_parallel/c9d0714785adc100345835c1989f7c657e01f629/src/utils/daemon.mli
ocaml
This breaks the type safety, but is necessary in order to allow select() * Spawning new process Alternate entry points Handler upon spawn and forked process. for unit tests Fork and run a function that communicates via the typed channels Where the daemon's output should go Spawn a new instance of the curr...
* * Copyright ( c ) 2015 , 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 . *...
2d1e98e3b11ff8cbb14cd6dbe2371f8edf597829fbe05962a4b21d5d9cc9fcee
michalrus/intero-nix-shim
Main.hs
module InteroNixShim.Main where import Control.Monad (when) import Data.Foldable (find, traverse_) import Data.List (stripPrefix) import qualified Data.List.Split as S import Data.Maybe (catMaybes, fromMaybe, maybe) import Data.S...
null
https://raw.githubusercontent.com/michalrus/intero-nix-shim/59776d8b39eba7473bc3424eff5e391728911879/src/InteroNixShim/Main.hs
haskell
-nix-shim/issues/1 stack handles this by loading the library and all executables, excluding can't do much better than just using the default target. verbose=0 ` to ` cabal repl ` or users ’ errors wo n’t be shown in Flycheck . FIXME: suboptimal…
module InteroNixShim.Main where import Control.Monad (when) import Data.Foldable (find, traverse_) import Data.List (stripPrefix) import qualified Data.List.Split as S import Data.Maybe (catMaybes, fromMaybe, maybe) import Data.S...
9d033c3fcc0c6fd2f7d2ffebc149c81e3b703be5ab36a09f7b0879c2a255aad0
janestreet/hardcaml_circuits
lfsr.mli
(** Linear feedback shift registers *) open Base open! Hardcaml module Config : sig type t = | Galois | Fibonacci [@@deriving enumerate, sexp_of] end module Op : sig type t = | Xor | Xnor [@@deriving enumerate, sexp_of] end * Create the update logic for a lfsr . Used in conjuction with [ r...
null
https://raw.githubusercontent.com/janestreet/hardcaml_circuits/a2c2d1ea3e6957c3cda4767d519e94c20f1172b2/src/lfsr.mli
ocaml
* Linear feedback shift registers * default is [Galois]. * default is [false]. * default is [Xor]
open Base open! Hardcaml module Config : sig type t = | Galois | Fibonacci [@@deriving enumerate, sexp_of] end module Op : sig type t = | Xor | Xnor [@@deriving enumerate, sexp_of] end * Create the update logic for a lfsr . Used in conjuction with [ reg_fb ] to construct a complete [...
5f851d4d13dbaae635ea3c908f2350b03769c8e9287c23ce5e84762996f63962
sgbj/MaximaSharp
ddot.lisp
;;; Compiled by f2cl version: ( " f2cl1.l , v 1.221 2010/05/26 19:25:52 " " f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ " " f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ " " f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ " " f2cl5.l , v 1.204 2010/02/23 05:21:30 " " f2cl6.l , v 1.48 2008/08/...
null
https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/colnew/lisp/ddot.lisp
lisp
Compiled by f2cl version: Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t) (:coerce-assigns :as-needed) (:array-type ':array) (:array-slicing t) (:declare-common nil) (:float-format double-float))
( " f2cl1.l , v 1.221 2010/05/26 19:25:52 " " f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ " " f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ " " f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ " " f2cl5.l , v 1.204 2010/02/23 05:21:30 " " f2cl6.l , v 1.48 2008/08/24 00:56:27 rtoy Exp $ " " ...
92712eabac625d4be335530fa3341e5e68221201261a953afd02d2418c479f9f
Haskell-Things/ImplicitCAD
Expr.hs
{- ORMOLU_DISABLE -} Implicit CAD . Copyright ( C ) 2011 , ( ) Copyright ( C ) 2014 - 2017 , ( ) -- Released under the GNU AGPLV3+, see LICENSE Allow us to use shorter forms of Var and Name . # LANGUAGE PatternSynonyms # -- Allow us to use string literals for Text {-# LANGUAGE OverloadedStrings #-} modul...
null
https://raw.githubusercontent.com/Haskell-Things/ImplicitCAD/5ce28f01fda1c5285959040fe7d1eb63a1d09aef/tests/ParserSpec/Expr.hs
haskell
ORMOLU_DISABLE Released under the GNU AGPLV3+, see LICENSE Allow us to use string literals for Text # LANGUAGE OverloadedStrings # Be explicit about what we import. Our utility library, for making these tests easier to read. > Var "foo" > > > num 0 > num 0 > bool True > bool False > undefined > Var "foo" > Var "f...
Implicit CAD . Copyright ( C ) 2011 , ( ) Copyright ( C ) 2014 - 2017 , ( ) Allow us to use shorter forms of Var and Name . # LANGUAGE PatternSynonyms # module ParserSpec.Expr (exprSpec) where import Prelude (Bool(True, False), ($)) Hspec , for writing specs . import Test.Hspec (describe, Spec, it, s...
28cec08a65e13467c687b8c93116c35a22ec2fb0d4a21fd875c81e3ebeb31900
aaronallen8455/hi-fi
FoldFields.hs
# LANGUAGE RecordWildCards # module HiFi.TcPlugin.FoldFields ( buildFoldFieldsExpr ) where import Data.Either import Data.Functor ((<&>)) import qualified HiFi.GhcFacade as Ghc import HiFi.TcPlugin.PluginInputs import HiFi.TcPlugin.RecordParts import HiFi.TcPlugin...
null
https://raw.githubusercontent.com/aaronallen8455/hi-fi/2ddc5c4f5e2922806b35c70645c625b39e0820ea/src/HiFi/TcPlugin/FoldFields.hs
haskell
| Make the binder for the function that produces the x terms forall a. (C (FieldTy f a) => String -> (HKD rec f -> FieldTy f a) -> x | Make the expr that results from applying all arguments (including the dict) to the user supplied function that generates a value for each field. | Attempt to solve a const...
# LANGUAGE RecordWildCards # module HiFi.TcPlugin.FoldFields ( buildFoldFieldsExpr ) where import Data.Either import Data.Functor ((<&>)) import qualified HiFi.GhcFacade as Ghc import HiFi.TcPlugin.PluginInputs import HiFi.TcPlugin.RecordParts import HiFi.TcPlugin...
ebe41707d30027e5dd4274058ae31316145b7bfa32320eefb0b6bde64d86c059
ryo-imai-bit/Writing-An-Interpreter-In-Go-In-OCaml
env.ml
module Env = struct include Object include Ast type env = { store: (string, Object.obj) Hashtbl.t; outer: env option; } let newEnv () = { store = Hashtbl.create 100; outer = None; } let getEnv = { store = Hashtbl.create 100; outer = None; } let newEnclosedEnv env = { st...
null
https://raw.githubusercontent.com/ryo-imai-bit/Writing-An-Interpreter-In-Go-In-OCaml/8a2d13b6582d637560e8d327a05bcdfb7831a178/lib/env.ml
ocaml
module Env = struct include Object include Ast type env = { store: (string, Object.obj) Hashtbl.t; outer: env option; } let newEnv () = { store = Hashtbl.create 100; outer = None; } let getEnv = { store = Hashtbl.create 100; outer = None; } let newEnclosedEnv env = { st...
d0d981704dede39950092119515a179bd932c4be374d2443617bb94b263a1eaa
0xd34df00d/lcss
site.hs
-------------------------------------------------------------------------------- # LANGUAGE OverloadedStrings , QuasiQuotes , LambdaCase # # LANGUAGE RecordWildCards # {-# LANGUAGE RankNTypes #-} # LANGUAGE ParallelListComp # # LANGUAGE NoMonomorphismRestriction # import Hakyll import Text.Pandoc.Op...
null
https://raw.githubusercontent.com/0xd34df00d/lcss/ebcec028ea1fc68fcf52735eeddc1044a9f84584/site.hs
haskell
------------------------------------------------------------------------------ # LANGUAGE RankNTypes # ------------------------------------------------------------------------------ ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings , QuasiQuotes , LambdaCase # # LANGUAGE RecordWildCards # # LANGUAGE ParallelListComp # # LANGUAGE NoMonomorphismRestriction # import Hakyll import Text.Pandoc.Options import Text.Pandoc.Walk import Text.Pandoc.Definition import qualified Data.Map.La...
90cb4f8463afae09073c27c7d71cd4a7bc2d182d8b2ba3e74ea59229870aeea0
larcenists/larceny
num-iters.scm
(define boyer-iters 10) (define browse-iters 600) (define conform-iters 20) (define cpstak-iters 300) (define ctak-iters 30) (define dderiv-iters 800000) (define deriv-iters 800000) (define destruc-iters 300) (define diviter-iters 400000) (define divrec-iters 400000) (define ea...
null
https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Stress/src/num-iters.scm
scheme
problem size, not iterations
(define boyer-iters 10) (define browse-iters 600) (define conform-iters 20) (define cpstak-iters 300) (define ctak-iters 30) (define dderiv-iters 800000) (define deriv-iters 800000) (define destruc-iters 300) (define diviter-iters 400000) (define divrec-iters 400000) (define ea...
fa069f5eadfcec9589eef05a68753f8b08d9026ab82059c1b4e7351b15ad3406
lispbuilder/lispbuilder
sdl-util.lisp
SDL ( Simple Media Layer ) library using CFFI for foreign function interfacing ... ( C)2006 Justin Heyes - Jones < > and < > Thanks to and ;; see COPYING for license This file contains some useful functions for using SDL from Common lisp ;; using sdl.lisp (the CFFI wrapper) (in-package #:lispbuilder-sd...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/base/sdl-util.lisp
lisp
see COPYING for license using sdl.lisp (the CFFI wrapper) w LJC: Make sure filename is a string and the filename exists.
SDL ( Simple Media Layer ) library using CFFI for foreign function interfacing ... ( C)2006 Justin Heyes - Jones < > and < > Thanks to and This file contains some useful functions for using SDL from Common lisp (in-package #:lispbuilder-sdl-base) (defmacro with-init (init-flags &body body) "Attemp...
88a571e818ed767bf6f9cab305c8bdcfeb863b52ad189c8d563dcaa6ee3f8501
facebook/pyre-check
taintTransforms.mli
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
null
https://raw.githubusercontent.com/facebook/pyre-check/fec4eee4c4c49027b624d02a2191f76fe798213c/source/interprocedural_analyses/taint/taintTransforms.mli
ocaml
A:B:C represents the transforms for x in `x = A(B(C(taint)))` A:B:C represents the transforms for x in `taint = C(B(A(x)))` Split a list of transforms into sanitizers present at the beginning and the rest. Return sanitizers that are still valid (i.e, before a named transform. Discard all sanitizers, regardless...
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
eabd4ade79c1884bb346f9c5f4df4795d5094db45c1f8fbbdfefbce2a930c980
Innf107/polaris
modules.ml
open Syntax let _export_category, trace_exports = Trace.make ~flag:"exports" ~prefix:"Exports" let extract_import_paths_mod = Parsed.MExpr.collect_list begin function | Import (_, path) -> [path] | _ -> [] end let extract_import_paths = Parsed.Expr.collect_list begin function | LetModuleSeq (_, _, me...
null
https://raw.githubusercontent.com/Innf107/polaris/d273b97fa607dd4c70a17a07abd230a921e3817c/src/modules.ml
ocaml
open Syntax let _export_category, trace_exports = Trace.make ~flag:"exports" ~prefix:"Exports" let extract_import_paths_mod = Parsed.MExpr.collect_list begin function | Import (_, path) -> [path] | _ -> [] end let extract_import_paths = Parsed.Expr.collect_list begin function | LetModuleSeq (_, _, me...
4e9e96204ca6016084d5f18c675464fda44cda331ab2fe03ae033fe705717190
olleharstedt/pholyglot
Infer.ml
(* * Module to infer types of local variables * Both inferring types of expression, but also iterating the ast to replace Infer_me with proper types. *) open Printf open Ast module Log = Dolog.Log exception Type_error of string (** * Global variable * Should only be used by Function_call expression to replace t...
null
https://raw.githubusercontent.com/olleharstedt/pholyglot/644dc134d98091bcb7e2946cd98d9f4775262afd/src/lib/Infer.ml
ocaml
* Module to infer types of local variables * Both inferring types of expression, but also iterating the ast to replace Infer_me with proper types. * * Global variable * Should only be used by Function_call expression to replace type variables in Function_type * TODO: Would this work when wrapping multiple gener...
open Printf open Ast module Log = Dolog.Log exception Type_error of string let t_vars_tbl : (string, typ) Hashtbl.t = Hashtbl.create 10 let rec typ_of_lvalue ns lv : typ = Log.debug "%s %s" "typ_of_lvalue" (show_lvalue lv); match lv with | Variable id -> begin match Namespace.find_identifier n...
490fc8a5a7b079061627fdadac2f7d5233a5c9f2585d0fc74b671de9d6b9c733
janestreet/universe
managed_on_failure.ml
open Core open Async module T = struct type 'worker functions = { fail : ('worker, unit, unit) Rpc_parallel.Function.t } module Worker_state = struct type init_arg = unit [@@deriving bin_io] type t = unit end module Connection_state = struct type init_arg = unit [@@deriving bin_io] type t = u...
null
https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/rpc_parallel/expect_test/managed_on_failure.ml
ocaml
open Core open Async module T = struct type 'worker functions = { fail : ('worker, unit, unit) Rpc_parallel.Function.t } module Worker_state = struct type init_arg = unit [@@deriving bin_io] type t = unit end module Connection_state = struct type init_arg = unit [@@deriving bin_io] type t = u...
3e8ff0d7569b9e5325f3f31fca27b35fa786ae6c31950e262fd622f7c79e72be
reach-sh/reach-lang
ETH_solc.hs
module Reach.Connector.ETH_solc ( compile_sol_ , compile_sol_extract , CompiledSolRec(..) ) where import Control.Monad.Reader import Data.Aeson as Aeson import Data.Aeson.Encode.Pretty import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy.Char8 as LB import qualified Data.Map.Strict as M...
null
https://raw.githubusercontent.com/reach-sh/reach-lang/50e090b1c4134c33c8e3082844c31df1a397dd48/hs/src/Reach/Connector/ETH_solc.hs
haskell
, OP { .. } , OP { opInliner = False, .. } The names come from #L248 None of these can make stack problems worse Turn into SSA and simplify Perform structural simplification Simplify again Reverse SSA should have good "compilability" property here. Run functional expression inliner Prune a bit more in SSA Tur...
module Reach.Connector.ETH_solc ( compile_sol_ , compile_sol_extract , CompiledSolRec(..) ) where import Control.Monad.Reader import Data.Aeson as Aeson import Data.Aeson.Encode.Pretty import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy.Char8 as LB import qualified Data.Map.Strict as M...
e8529ba3a573a636843c1d2eee077839bbb2c8036c0288fdcc494c051b49d488
phochste/clj-marc
marc4j.clj
( c ) 2010 < > (ns ^{:doc "A wrapper around Marc4j for parsing MARC21/MARCXML documents" :author "Patrick Hochstenbach"} clj-marc.marc4j (:import (java.io FileInputStream)) (:import (org.marc4j MarcStreamReader MarcXmlReader MarcReader)) (:import (org.marc4j.marc Record Leader DataField ControlField)) ...
null
https://raw.githubusercontent.com/phochste/clj-marc/70ba82dc378351ab7f520aad53515aa4342f60ec/src/clj_marc/marc4j.clj
clojure
( c ) 2010 < > (ns ^{:doc "A wrapper around Marc4j for parsing MARC21/MARCXML documents" :author "Patrick Hochstenbach"} clj-marc.marc4j (:import (java.io FileInputStream)) (:import (org.marc4j MarcStreamReader MarcXmlReader MarcReader)) (:import (org.marc4j.marc Record Leader DataField ControlField)) ...
dfc11fca519967b73d4a483a937369889edba4500f98b766b1de6bf924d3302e
luno-lang/luno
scope.ml
open Batteries open Frontend.Ast exception NotInScope of string (* Our scope which contains a mapping between symbol names and types *) module Env = Map.Make (String) let new_env = Env.empty let lookup_symbol (env : 'a Env.t) sym = try Env.find sym env with Not_found -> failwith "not in scope" let has_symbol env...
null
https://raw.githubusercontent.com/luno-lang/luno/e1b7db6ab70e5a74bf95110943c39511dd727585/lib/semant/scope.ml
ocaml
Our scope which contains a mapping between symbol names and types
open Batteries open Frontend.Ast exception NotInScope of string module Env = Map.Make (String) let new_env = Env.empty let lookup_symbol (env : 'a Env.t) sym = try Env.find sym env with Not_found -> failwith "not in scope" let has_symbol env sym = match Env.find_opt sym env with | Some _ -> true | None -> ...
24ba993c7dcda9d1b9a8cf0c4d67c322c582ea9b7a9f0dfc74d6e76c2877b6f3
graninas/Hydra
IOException2Spec.hs
# LANGUAGE FunctionalDependencies # {-# LANGUAGE PackageImports #-} {-# LANGUAGE TemplateHaskell #-} module Hydra.Tests.Integration.IOException2Spec where import qualified Control.Exception as E import qualified Prelude as P (writeFile, readFile) import Hydra.Prelude import qualified Hydra.D...
null
https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-free/test/Hydra/Tests/Integration/IOException2Spec.hs
haskell
# LANGUAGE PackageImports # # LANGUAGE TemplateHaskell # Samples for the book Language-level error types: Language itself:
# LANGUAGE FunctionalDependencies # module Hydra.Tests.Integration.IOException2Spec where import qualified Control.Exception as E import qualified Prelude as P (writeFile, readFile) import Hydra.Prelude import qualified Hydra.Domain as D import qualified Hydra.Language as L impo...
7ab543621c553739e3c58a938df2344c5bc47951ecda5f5b843798b42d203060
forward/incanter-BLAS
bayes.clj
bayes.clj -- Bayesian estimation library for Clojure by March 11 , 2009 Copyright ( c ) , 2009 . All rights reserved . The use and distribution terms for this software are covered by the Eclipse ;; Public License 1.0 (-1.0.php) ;; which can be found in the file epl-v10.htincanter.at the root of thi...
null
https://raw.githubusercontent.com/forward/incanter-BLAS/da48558cc9d8296b775d8e88de532a4897ee966e/src/main/clojure/incanter/bayes.clj
clojure
Public License 1.0 (-1.0.php) which can be found in the file epl-v10.htincanter.at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software. view trace plots view histograms...
bayes.clj -- Bayesian estimation library for Clojure by March 11 , 2009 Copyright ( c ) , 2009 . All rights reserved . The use and distribution terms for this software are covered by the Eclipse CHANGE LOG March 11 , 2009 : First version (ns ^{:doc "This is library provides functions for pe...
76d4824d5b508bac2ba71727578a481efdff6835ecbabc311be098a088272dfe
achirkin/vulkan
VK_EXT_memory_priority.hs
# OPTIONS_HADDOCK not - home # {-# LANGUAGE DataKinds #-} {-# LANGUAGE MagicHash #-} # LANGUAGE PatternSynonyms # {-# LANGUAGE Strict #-} {-# LANGUAGE ViewPatterns #-} module Graphics.Vulkan.Ext.VK_EXT_memory_priority * Vulkan extension : @VK_EXT_memory_priority@ -- | -- ...
null
https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_EXT_memory_priority.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE MagicHash # # LANGUAGE Strict # # LANGUAGE ViewPatterns # | supported: @vulkan@ author: @EXT@ type: @device@ Required extensions: 'VK_KHR_get_physical_device_properties2'. ** Required extensions: 'VK_KHR_get_physical_device_properties2'. > #include...
# OPTIONS_HADDOCK not - home # # LANGUAGE PatternSynonyms # module Graphics.Vulkan.Ext.VK_EXT_memory_priority * Vulkan extension : @VK_EXT_memory_priority@ contact : @Jeff Bolz @jeffbolznv@ Extension number : @239@ module Graphics.Vulkan.Marshal, AHardwareBuffer(), ANativeWindow(), CAMetalLayer()...
d9e5c6b87b26da2d55c0e9e698e573c6b0945b9e22c752e4c2c3fa222d478564
satori-com/mzbench
loop_rate.erl
[{pool, [{size, 1}, {worker_type, dummy_worker}], [{loop, [{time, {200, ms}}, {rate, {1.1, rps}}], [{print, "loop#1"}]}, {loop, [{time, {0.2, sec}}, {rate, {1, rpm}}], [{print, "loop#2"}]}, {loop, [{time, {0.0033, min}}, {rate, {1.1, rph}}], [{print, "loop#3"}]}, ...
null
https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/acceptance_tests/scripts/loop_rate.erl
erlang
[{pool, [{size, 1}, {worker_type, dummy_worker}], [{loop, [{time, {200, ms}}, {rate, {1.1, rps}}], [{print, "loop#1"}]}, {loop, [{time, {0.2, sec}}, {rate, {1, rpm}}], [{print, "loop#2"}]}, {loop, [{time, {0.0033, min}}, {rate, {1.1, rph}}], [{print, "loop#3"}]}, ...
d8e815351689416c052bcbddcf55bee0c8d0c808b307b7dac23a57bd4dfeff86
eponai/sulolive
main.cljs
(ns env.web.main (:require [eponai.web.app :as app] [eponai.client.devtools :as devtools] )) (defn ^:export runsulo [] (devtools/install-app) (app/run-simple {}))
null
https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/env/client/simple/env/web/main.cljs
clojure
(ns env.web.main (:require [eponai.web.app :as app] [eponai.client.devtools :as devtools] )) (defn ^:export runsulo [] (devtools/install-app) (app/run-simple {}))
16b44549159b2df48b3a39dd6859045349d1e0f8c360efbf985494f0182aa219
Viasat/halite
test_propagate.clj
Copyright ( c ) 2022 Viasat , Inc. Licensed under the MIT license (ns com.viasat.halite.test-propagate (:require [com.viasat.halite.choco-clj-opt :as choco-clj] [com.viasat.halite.propagate :as propagate] [com.viasat.halite.transpile.lowering :as lowering] [com.viasat.halite.t...
null
https://raw.githubusercontent.com/Viasat/halite/a5f81473dadc1b8e63ed6744d3b0154098f1b3ab/test/com/viasat/halite/test_propagate.clj
clojure
(run-tests)
Copyright ( c ) 2022 Viasat , Inc. Licensed under the MIT license (ns com.viasat.halite.test-propagate (:require [com.viasat.halite.choco-clj-opt :as choco-clj] [com.viasat.halite.propagate :as propagate] [com.viasat.halite.transpile.lowering :as lowering] [com.viasat.halite.t...
e8b899272b67defdc89bc64b45c8a5825805759ac924eb560917c413af7d1aab
reanimate/reanimate
BoundingBox.hs
| Bounding - boxes can be immensely useful for aligning objects but they are not part of the SVG specification and can not be computed for all SVG nodes . In particular , you 'll get bad results when asking for the bounding boxes of Text nodes ( because fonts are difficult ) , clipped nodes , and fi...
null
https://raw.githubusercontent.com/reanimate/reanimate/2d2a37b6acc2f683c9ca1339678ddf75b31b740e/src/Reanimate/Svg/BoundingBox.hs
haskell
| Return bounding box of SVG tree. Note: Bounding boxes are computed on a best-effort basis and will not work in all cases. The only supported SVG nodes are: path, circle, polyline, The box for the svg node is based on the document's width and height (if both are present). | Height of SVG n...
| Bounding - boxes can be immensely useful for aligning objects but they are not part of the SVG specification and can not be computed for all SVG nodes . In particular , you 'll get bad results when asking for the bounding boxes of Text nodes ( because fonts are difficult ) , clipped nodes , and fi...
202dddf5f2e6c2dc0e23ddb51bd383aa0a74d06cf50f31c5f4604df18e0f898a
kupl/FixML
sub28.ml
type formula = | True | False | Not of formula | AndAlso of formula * formula | OrElse of formula * formula | Imply of formula * formula | Equal of exp * exp and exp = | Num of int | Plus of exp * exp | Minus of exp * exp let rec arithmetic = fun f -> match f with | Num num -> num | Plus(num1,num2...
null
https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/formula/formula1/submissions/sub28.ml
ocaml
type formula = | True | False | Not of formula | AndAlso of formula * formula | OrElse of formula * formula | Imply of formula * formula | Equal of exp * exp and exp = | Num of int | Plus of exp * exp | Minus of exp * exp let rec arithmetic = fun f -> match f with | Num num -> num | Plus(num1,num2...
3391680132fc4401ae7203b87a35464decc927835a51fa7d15d55c7605979cba
oxidizing/sihl
web_static.ml
let middleware () = let local_path = Option.value (Core_configuration.read_string "PUBLIC_DIR") ~default:"./public" in let internal_uri_prefix = Option.value (Core_configuration.read_string "PUBLIC_URI_PREFIX") ~default:"/assets" in let uri_prefix = Web.externalize_path interna...
null
https://raw.githubusercontent.com/oxidizing/sihl/c6786f25424c1b9f40ce656e908bd31515f1cd09/sihl/src/web_static.ml
ocaml
let middleware () = let local_path = Option.value (Core_configuration.read_string "PUBLIC_DIR") ~default:"./public" in let internal_uri_prefix = Option.value (Core_configuration.read_string "PUBLIC_URI_PREFIX") ~default:"/assets" in let uri_prefix = Web.externalize_path interna...
bd27eef44a18ab6e4ba8dece727b6b2cef1a90a62d90b1455eb33b28480af0cc
dradtke/Lisp-Text-Editor
selections.lisp
(in-package :gtk-cffi) (defclass target-list (object) ())
null
https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/gtk-cffi-20120208-cvs/gtk/selections.lisp
lisp
(in-package :gtk-cffi) (defclass target-list (object) ())
033b73bfab21bf11cd56415acb10f84c5e53871702012a7c04d69d937f5b98a1
racket/web-server
cookies-test.rkt
#lang racket/base (require rackunit racket/promise racket/list racket/match racket/file (for-syntax racket/base) net/url net/cookies/common (except-in net/cookies/server make-cookie) web-server/http/request-structs ...
null
https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-test/tests/web-server/http/cookies-test.rkt
racket
comment is now ignored RFC 6265 no longer gives special meaning to "$Version" "$Path" or "$Domain" new version of request-cookies never populates path or domain new version of request-cookies never populates path or domain new version of request-cookies never populates path or domain this is rejected if there is a \n b...
#lang racket/base (require rackunit racket/promise racket/list racket/match racket/file (for-syntax racket/base) net/url net/cookies/common (except-in net/cookies/server make-cookie) web-server/http/request-structs ...
594b4e90691eb98e57c96b5b49210ed90da4d0fd559107e7ecc0b0e1cd0b33c5
dinosaure/tuyau
tuyau_caml_strings.mli
type flow = { mutable input : string list ; output : string Queue.t } val strings : string list Tuyau_caml.key val strings_protocol : flow Tuyau_caml.Witness.protocol
null
https://raw.githubusercontent.com/dinosaure/tuyau/8ed849805153f5dfad6c045782e3d20ef06cd9b6/caml/tuyau_caml_strings.mli
ocaml
type flow = { mutable input : string list ; output : string Queue.t } val strings : string list Tuyau_caml.key val strings_protocol : flow Tuyau_caml.Witness.protocol
052a8a5cf8318ff46ad0f4d41bed92627d87646037d54d87c194485a16bc4024
apache/couchdb-fabric
fabric_group_info.erl
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 % % -2.0 % % Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an " A...
null
https://raw.githubusercontent.com/apache/couchdb-fabric/ce62148d0a4469751d8078cc223684da29b5d4a7/src/fabric_group_info.erl
erlang
use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations...
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not distributed under the License is distributed on an " AS IS " BASIS , WITHOUT -module(fabric_group_info). -export([go/2]). -include_lib("fabric/include/fabric.hrl"). -include_lib("mem3/include/mem3.hrl"). -include_lib("couch/include...
7e85f10f6a135654b6fdbc39a92d1b89fceec38baa387c66331268f854cb7c95
janestreet/hardcaml_fixed_point
test_resize.ml
open! Base open Hardcaml open! Expect_test_helpers_base module Unsigned = Hardcaml_fixed_point.Unsigned (Bits) module Signed = Hardcaml_fixed_point.Signed (Bits) let test_round (type a) (module X : Hardcaml_fixed_point.Fixed_point with type t = a and type bits = Bits.t) width_int_a width_frac_a...
null
https://raw.githubusercontent.com/janestreet/hardcaml_fixed_point/52ac071c3dea60595d70f2c36d1e5b77d21b77ea/test/test_resize.ml
ocaml
open! Base open Hardcaml open! Expect_test_helpers_base module Unsigned = Hardcaml_fixed_point.Unsigned (Bits) module Signed = Hardcaml_fixed_point.Signed (Bits) let test_round (type a) (module X : Hardcaml_fixed_point.Fixed_point with type t = a and type bits = Bits.t) width_int_a width_frac_a...
0e32cb35a4d54e3c4a6e32ff1d598d477e1448616399a1d9a019d2451c9fa37e
project-oak/hafnium-verification
accessTreeTests.ml
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/unit/accessTreeTests.ml
ocaml
string set domain we use to ensure we're getting the expected traces total hack of a widening just to test that widening of traces is working similarly, hack printing so top looks different exact access path tests starred access path tests starred tree tests get_trace is just (fst get_node), so light tests...
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
02d2d4a4c3e7f7ecc27541c9a1cac0796b3ed243e2a18133d94d8efe68ebc44c
vrom911/Rum
ExprParser.hs
module Compiler.Rum.Internal.ExprParser where import qualified Data.HashMap.Strict as HM import Data.List (foldl') import Text.Megaparsec import Text.Megaparsec.String import Compiler.Rum.Internal.AST strSpace :: String -> Parser String strSpace s = string s >>= \x -> space >>...
null
https://raw.githubusercontent.com/vrom911/Rum/b060ff099cb0cb7c022b10902a7852d6c1ef1498/src/Compiler/Rum/Internal/ExprParser.hs
haskell
module Compiler.Rum.Internal.ExprParser where import qualified Data.HashMap.Strict as HM import Data.List (foldl') import Text.Megaparsec import Text.Megaparsec.String import Compiler.Rum.Internal.AST strSpace :: String -> Parser String strSpace s = string s >>= \x -> space >>...
058f5533903a9678807df4e6b8bcd38fe283e5af181e372ae7532d1b7239538b
audreyt/openafp
ERG.hs
module OpenAFP.Records.AFP.ERG where import OpenAFP.Types import OpenAFP.Internals data ERG = ERG { erg_Type :: !N3 ,erg_ :: !N3 ,erg :: !NStr } deriving (Show, Typeable)
null
https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/AFP/ERG.hs
haskell
module OpenAFP.Records.AFP.ERG where import OpenAFP.Types import OpenAFP.Internals data ERG = ERG { erg_Type :: !N3 ,erg_ :: !N3 ,erg :: !NStr } deriving (Show, Typeable)
6b631399915fdd0a3e3f3a3f9e62bc524812849b44df8b0bb16471a2f3cbd5c9
district0x/district-ui-web3
utils.cljs
(ns district.ui.web3.utils) (defn web3-injected? "Determines if the `web3` object has been injected by an ethereum provider." [] (boolean (or (aget js/window "ethereum" ) (aget js/window "web3")))) (defn web3-legacy? "The old method of retrieving the current ethereum provider exposed it at `window.web3....
null
https://raw.githubusercontent.com/district0x/district-ui-web3/825785b70b653e82cd5bf66f0df69862d8f60bd0/src/district/ui/web3/utils.cljs
clojure
(ns district.ui.web3.utils) (defn web3-injected? "Determines if the `web3` object has been injected by an ethereum provider." [] (boolean (or (aget js/window "ethereum" ) (aget js/window "web3")))) (defn web3-legacy? "The old method of retrieving the current ethereum provider exposed it at `window.web3....
e7ee69f1ebd701e7809fc2d3b729caab95de099f1d5faaa8aa5245a5a5d9f538
JonyEpsilon/darwin
metrics.clj
; This file is part of . ; Copyright ( C ) 2014- , Imperial College , London , All rights reserved . ; Contributors : ; Released under the MIT license .. ; (ns darwin.evolution.metrics "Functions for capturing metrics for the run.") (def metrics (atom {})) (defn clear! "Reset the metrics." [] (res...
null
https://raw.githubusercontent.com/JonyEpsilon/darwin/2b27aa83ec0b7bbc37effed243bf92673de586ea/src/darwin/evolution/metrics.clj
clojure
This file is part of . Copyright ( C ) 2014- , Imperial College , London , All rights reserved . Contributors : Released under the MIT license .. (ns darwin.evolution.metrics "Functions for capturing metrics for the run.") (def metrics (atom {})) (defn clear! "Reset the metrics." [] (reset! metric...
3f516dc3a3ee97d3e7aaba4ce35dac2e012b0038f6412ec0a64742b274169172
monadbobo/ocaml-core
extended_list_test.ml
open Core.Std open OUnit module L = Core_extended.Std.List let is_even x = x mod 2 = 0 let test = "Extended_list" >::: [ "number" >:: (fun () -> "base" @? (L.number [1;2;3;1;4] = [1,0;2,0;3,0;1,1;4,0])); "multimerge" >:: (fun () -> "base" @? (L.multimerge [[0;2];[2;3];[0;1];[1;2]] = [0;1;2;...
null
https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib_test/extended_list_test.ml
ocaml
There is no solution here: we just want to make sure that the result has all the fields.
open Core.Std open OUnit module L = Core_extended.Std.List let is_even x = x mod 2 = 0 let test = "Extended_list" >::: [ "number" >:: (fun () -> "base" @? (L.number [1;2;3;1;4] = [1,0;2,0;3,0;1,1;4,0])); "multimerge" >:: (fun () -> "base" @? (L.multimerge [[0;2];[2;3];[0;1];[1;2]] = [0;1;2;...
14d3032bc39b671ce79321456b3fd3534738d3a39e1318ad42ee5e5bd796c692
RyanGlScott/ghc-software-foundations
Perm.hs
# LANGUAGE DataKinds # {-# LANGUAGE GADTs #-} module SF.VFA.Perm where import Data.Type.Equality import Prelude.Singletons import SF.LF.Logic import SF.LF.Poly data Permutation :: forall a. [a] -> [a] -> Prop where PermNil :: Permutation '[] '[] PermSkip :: forall a (x :: a) (l :: [a]) (l' :: [a]). ...
null
https://raw.githubusercontent.com/RyanGlScott/ghc-software-foundations/ce7b8958e0aed4fb2c8611d71e7e0f1a2ef83222/verified-functional-algorithms/src/SF/VFA/Perm.hs
haskell
# LANGUAGE GADTs #
# LANGUAGE DataKinds # module SF.VFA.Perm where import Data.Type.Equality import Prelude.Singletons import SF.LF.Logic import SF.LF.Poly data Permutation :: forall a. [a] -> [a] -> Prop where PermNil :: Permutation '[] '[] PermSkip :: forall a (x :: a) (l :: [a]) (l' :: [a]). Sing x -> Permutati...
a5e2c00b5a5629f511d2100b306c3eff495206ce4bb814c8a93a60e8a048390e
klutometis/clrs
stack-queue.scm
(define (stack-enqueue! stack x) (let* ((data (stack-data stack)) (length (vector-length data)) (temp (make-stack (make-vector length #f) -1))) (push! temp x) (loop ((until (stack-empty? stack))) (push! temp (pop! stack))) (loop ((until (stack-empty? temp))) (push! st...
null
https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/10.1/stack-queue.scm
scheme
(define (stack-enqueue! stack x) (let* ((data (stack-data stack)) (length (vector-length data)) (temp (make-stack (make-vector length #f) -1))) (push! temp x) (loop ((until (stack-empty? stack))) (push! temp (pop! stack))) (loop ((until (stack-empty? temp))) (push! st...
e108ebfbc9846d8f39e2c4e078a270884ba9407cd72ebe5739fff9d4c857a234
rbardou/red
log.ml
let handlers = ref [] let add_handler (handler: string -> unit) = handlers := handler :: !handlers let info m = List.iter (fun handler -> handler m) !handlers let info x = Printf.ksprintf info x let warn m = info "Warning: %s" m let warn x = Printf.ksprintf warn x let error ?exn message = match exn with | N...
null
https://raw.githubusercontent.com/rbardou/red/e23c2830909b9e5cd6afe563313435ddaeda90bf/src/log.ml
ocaml
let handlers = ref [] let add_handler (handler: string -> unit) = handlers := handler :: !handlers let info m = List.iter (fun handler -> handler m) !handlers let info x = Printf.ksprintf info x let warn m = info "Warning: %s" m let warn x = Printf.ksprintf warn x let error ?exn message = match exn with | N...
24092bd1fd2459af8829af3330bde8920e5beb07ba8364d8495e78d82cfcf0ba
eckyputrady/haskell-scotty-realworld-example-app
HTTP.hs
module Feature.Auth.HTTP where import ClassyPrelude import Feature.Auth.Types import Feature.Common.Util (orThrow) import Feature.Common.HTTP import Control.Monad.Except import Web.Scotty.Trans import Network.HTTP.Types.Status class Monad m => Service m where resolveToken :: Token -> m (Either TokenError CurrentUse...
null
https://raw.githubusercontent.com/eckyputrady/haskell-scotty-realworld-example-app/366a1eec021fb1bfcbc2d8e0485b59cbedba10e5/src/Feature/Auth/HTTP.hs
haskell
module Feature.Auth.HTTP where import ClassyPrelude import Feature.Auth.Types import Feature.Common.Util (orThrow) import Feature.Common.HTTP import Control.Monad.Except import Web.Scotty.Trans import Network.HTTP.Types.Status class Monad m => Service m where resolveToken :: Token -> m (Either TokenError CurrentUse...
462f2733d612f76bb600e3f0a7262e30636131f82bb73f3af3773e7e74b157dd
clj-commons/useful
compress.clj
(ns flatland.useful.compress (:import [java.util.zip DeflaterOutputStream InflaterInputStream] [java.io ByteArrayOutputStream ByteArrayInputStream] [sun.misc BASE64Decoder BASE64Encoder])) (defn smash [^String str] (let [out (ByteArrayOutputStream.)] (doto (DeflaterOutputStream. out) ...
null
https://raw.githubusercontent.com/clj-commons/useful/dc5cdebf8983a2e2ea24ec8951fbb4dfb037da45/src/flatland/useful/compress.clj
clojure
(ns flatland.useful.compress (:import [java.util.zip DeflaterOutputStream InflaterInputStream] [java.io ByteArrayOutputStream ByteArrayInputStream] [sun.misc BASE64Decoder BASE64Encoder])) (defn smash [^String str] (let [out (ByteArrayOutputStream.)] (doto (DeflaterOutputStream. out) ...
33abfd04b6589ec11f857e8a5eb89091243f5bad228081b22946d8ff5a03e201
avras/nsime
nsime_ipv4_header.erl
%% Copyright ( C ) 2012 < > %% %% This file is part of nsime. %% nsime 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 3 of the License , or %% (at your option) any later version....
null
https://raw.githubusercontent.com/avras/nsime/fc5c164272aa649541bb3895d9f4bea34f45beec/src/nsime_ipv4_header.erl
erlang
This file is part of nsime. (at your option) any later version. nsime is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. along with...
Copyright ( C ) 2012 < > nsime 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 3 of the License , or You should have received a copy of the GNU General Public License Purpose ...
0fce15272e1ff847c17c0d3c79f38f49fbf45a79ccb8079c5ceffcd9736a8efd
nasa/PRECiSA
DecisionPathTest.hs
-- Notices: -- Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved . -- Disclaimers No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTO...
null
https://raw.githubusercontent.com/nasa/PRECiSA/91e1e7543c5888ad5fb123d3462f71d085b99741/PRECiSA/tests/Common/DecisionPathTest.hs
haskell
Notices: Disclaimers
Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved . No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTORY , INCLUDING , BUT NOT LIMIT...
b326bcbd8e7c8f27d0e2b46d98247636e7bdc578d98d10de4ee0dd2aaa3aa533
bryal/carth
Inferred.hs
# LANGUAGE TemplateHaskell , DataKinds # -- TODO: Can this and Checked be merged to a single, parametrized AST? | Type annotated AST as a result of typechecking module Front.Inferred (module Front.Inferred, Type, TConst, WithPos(..), TVar(..), TPrim(..), Const(..), Type' (..), TConst') where import Data.Set (Set) ...
null
https://raw.githubusercontent.com/bryal/carth/0c6026c82ce8ceb1a621c15a0e7505c4e6bc8782/src/Front/Inferred.hs
haskell
TODO: Can this and Checked be merged to a single, parametrized AST? have to keep as much state about environment definitions in later passes.
# LANGUAGE TemplateHaskell , DataKinds # | Type annotated AST as a result of typechecking module Front.Inferred (module Front.Inferred, Type, TConst, WithPos(..), TVar(..), TPrim(..), Const(..), Type' (..), TConst') where import Data.Set (Set) import qualified Data.Set as Set import Data.Map (Map) import Data.Bifu...
72ec7a6c8daffad54bf24348d00d3456445c1dc0be1d92947d47115a598a5db2
haroldcarr/learn-haskell-coq-ml-etc
P026_average.hs
module P026_average where average :: String -> Double average str = let numWords = wordCount str totalLength = sum (allLengths (words str)) in fromIntegral totalLength / fromIntegral numWords where wordCount :: String -> Int wordCount = length . words allLengths :: [String] -> [Int] ...
null
https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/idris/book/2017-Type_Driven_Development_with_Idris/src/P026_average.hs
haskell
module P026_average where average :: String -> Double average str = let numWords = wordCount str totalLength = sum (allLengths (words str)) in fromIntegral totalLength / fromIntegral numWords where wordCount :: String -> Int wordCount = length . words allLengths :: [String] -> [Int] ...
13d4be3e5e018d012c55bfee3863b51101fbd0d02a1c57da91ca563a2a06612b
ekmett/ekmett.github.com
Annotation.hs
# LANGUAGE TypeOperators # module Data.Rope.Annotation ( MonoidA(..) , ReducerA(..) , BreakableA(..) ) where import Data.Rope (Rope) class MonoidA f where -- | build an empty 'Annotation' emptyA :: f a | append two annotations appendA :: Rope -> f a -> Rope -> f b -> f c class Monoid...
null
https://raw.githubusercontent.com/ekmett/ekmett.github.com/8d3abab5b66db631e148e1d046d18909bece5893/haskell/rope/Data/Rope/Annotation.hs
haskell
| build an empty 'Annotation' | construct an 'Annotation' from a 'Rope' out of whole cloth | The 'Rope' has been updated to contains n more bytes on the right than the one used to build the 'Annotation', update the 'Annotation' | The 'Rope' contains n more bytes on the left than the one used to build the 'Annotatio...
# LANGUAGE TypeOperators # module Data.Rope.Annotation ( MonoidA(..) , ReducerA(..) , BreakableA(..) ) where import Data.Rope (Rope) class MonoidA f where emptyA :: f a | append two annotations appendA :: Rope -> f a -> Rope -> f b -> f c class MonoidA f => ReducerA f where unitA ...