_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 |
|---|---|---|---|---|---|---|---|---|
afb11418c55702a3d71f2162b81b7b600ee08a3cd7932f4f0e5bb86c3df69154 | sylphbio/pontiff | util.scm | (module util *
(import scheme)
(import chicken.base)
(import chicken.type)
(import chicken.string)
(import chicken.format)
(import chicken.process)
(import chicken.process-context)
(import chicken.port)
(import chicken.file)
(import chicken.io)
(import tabulae)
(import ix)
(define (die msg . args) (apply printf (con... | null | https://raw.githubusercontent.com/sylphbio/pontiff/8af6c1932e687b5f4219d2c649c1aa4bb92d543a/src/util.scm | scheme | XXX I'd kinda like to move this into tabulae as well but idk how to handle the custom errors cleanly | (module util *
(import scheme)
(import chicken.base)
(import chicken.type)
(import chicken.string)
(import chicken.format)
(import chicken.process)
(import chicken.process-context)
(import chicken.port)
(import chicken.file)
(import chicken.io)
(import tabulae)
(import ix)
(define (die msg . args) (apply printf (con... |
7eb5be33b64f5e3841c2dc511cb52bcdb0e3deb8b9c655e6187fc0bd21ac0cc7 | BillHallahan/G2 | Test41.hs | {-@ LIQUID "--no-termination" @-}
module Reverse (reverse) where
import Prelude hiding (length, reverse)
{-@ reverse :: x:[a] -> {r : [a] | ((-len x) + len r == 0)} @-}
reverse xs = go [] xs
go acc [] = acc
go acc (x:xs) = go (x:acc) xs | null | https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/test_files/Pos/Test41.hs | haskell | @ LIQUID "--no-termination" @
@ reverse :: x:[a] -> {r : [a] | ((-len x) + len r == 0)} @ |
module Reverse (reverse) where
import Prelude hiding (length, reverse)
reverse xs = go [] xs
go acc [] = acc
go acc (x:xs) = go (x:acc) xs |
951ef3f6c045289b0c68042dc7a0a07eef4023e64c06e0b28e008ba19e0d32a6 | DomainDrivenArchitecture/dda-managed-ide | serverspec.clj | Licensed to the Apache Software Foundation ( ASF ) under one
; or more contributor license agreements. See the NOTICE file
; distributed with this work for additional information
; regarding copyright ownership. The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
; "License"); you may not... | null | https://raw.githubusercontent.com/DomainDrivenArchitecture/dda-managed-ide/1a0d9b8dea4e3b7af1754bf99b38790a927d4d10/main/src/dda/pallet/dda_managed_ide/domain/serverspec.clj | clojure | or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
"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 b... | Licensed to the Apache Software Foundation ( ASF ) under one
to you under the Apache License , Version 2.0 ( the
distributed under the License is distributed on an " AS IS " BASIS ,
(ns dda.pallet.dda-managed-ide.domain.serverspec
(:require
[schema.core :as s]))
(s/defn serverspec-prerequisits
"serverspec... |
2478ecb2bb03c850797631bdb5a2d8362db6e6656399ea9b99be8a4c4e71f3de | arttuka/reagent-material-ui | macro_off_rounded.cljs | (ns reagent-mui.icons.macro-off-rounded
"Imports @mui/icons-material/MacroOffRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def macro-off-rounded (crea... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/macro_off_rounded.cljs | clojure | (ns reagent-mui.icons.macro-off-rounded
"Imports @mui/icons-material/MacroOffRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def macro-off-rounded (crea... | |
b132703c85d11c788a1a0b304b0efa62aee6970dbeb223b7a68a2c766c3a1705 | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-pubsub/gen/Gogol/PubSub/Projects/Topics/Snapshots/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Lists the names of the snapshots on this topic. Snapshots are used in <-overview Seek> operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
816d6b1078cac29f52e7a6a9e4da46e4cc8aa2cd1d58e814641a585ae6baa47d | qfpl/reflex-workshop | Limit.hs | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | null | https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/src/Workshop/Behaviors/Creating/Limit.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs # | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... |
aa4d28b213f07bb704fb111d8b57489a0310632f9030633d56c705b155a6ff6b | helpshift/kafboy | kafboy_http_handler.erl | %% @doc
%% web server that allows editing the json before sending to kafka
%% @end
-module(kafboy_http_handler).
-behaviour(cowboy_loop_handler).
-export([init/3]).
-export([handle/2, handle_method/3, handle_url/5, info/3]).
-export([terminate/3]).
-define(DEFAULT_HEADER,[{<<"content-type">>, <<"application/json; chars... | null | https://raw.githubusercontent.com/helpshift/kafboy/fae3c4ec358512797ee968c089b4675f95cd61c7/src/kafboy_http_handler.erl | erlang | @doc
web server that allows editing the json before sending to kafka
@end
includes
filed an issue, got an explanation at
No callback
Produce to topic
See bosky101/ekaf for what happens under the hood
connection pooling, batched writes, and so on
in case you want to create your own list, see the ... | -module(kafboy_http_handler).
-behaviour(cowboy_loop_handler).
-export([init/3]).
-export([handle/2, handle_method/3, handle_url/5, info/3]).
-export([terminate/3]).
-define(DEFAULT_HEADER,[{<<"content-type">>, <<"application/json; charset=utf-8">>}]).
-export([test_callback_edit_json/2]).
-include("kafboy_definitions... |
d02f716be8e858b2033b7f0fa657afbc36e0d7e0be99344fb8b959d334a18e27 | tweag/sparkle | StructField.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE UndecidableInstances #
module Control.Distributed.Spark.SQL.StructField where
import Control.Distributed.Spark.SQL.DataType
import Control.Dist... | null | https://raw.githubusercontent.com/tweag/sparkle/58700032c14b7f0246e5dd7148b708aa8a6d9740/src/Control/Distributed/Spark/SQL/StructField.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module Control.Distributed.Spark.SQL.StructField where
import Control.Distributed.Spark.SQL.DataType
import Control.Distributed.Spark.SQL.Metadata
import D... |
e4bd955762f3aa1c36d9c617f375856206d3ea9df1619ec5e285477633bcb545 | data61/Mirza | Org.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeApplications #
module Mirza.OrgRegistry.Tests.Org
( testOrgQueries
... | null | https://raw.githubusercontent.com/data61/Mirza/24e5ccddfc307cceebcc5ce26d35e91020b8ee10/projects/or_scs/test/Mirza/OrgRegistry/Tests/Org.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables # | # LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
module Mirza.OrgRegistry.Tests.Org
( testOrgQueries
) where
import Mirza.OrgRegistry.Handlers.Org
import Mirza.OrgRegistry.Types as ORT
import GHC.Stack ... |
a05ee5559e0afbe5857e01a2c63af7a059619319f038b78ce1e7845900f8725b | adinapoli/clj3D | leonardo.clj | (ns clj3D.examples.leonardo
(:refer-clojure :rename {+ core-+})
(:use
[clj3D math fl fenvs viewer] :reload))
;;main building
(def sq-l16-est (cuboid 16 16 15))
(def cil-cupolone (cylinder 8 8))
(def cal-cupolone (t 3 8 (dome 8)))
(def cupolone-est (struct2 (t 3 15) cil-cupolone cal-cupolone))
(def rect-puntal... | null | https://raw.githubusercontent.com/adinapoli/clj3D/1175bcaddc1d59fe37c6876dc8cc178417211e38/examples/leonardo.clj | clojure | main building | (ns clj3D.examples.leonardo
(:refer-clojure :rename {+ core-+})
(:use
[clj3D math fl fenvs viewer] :reload))
(def sq-l16-est (cuboid 16 16 15))
(def cil-cupolone (cylinder 8 8))
(def cal-cupolone (t 3 8 (dome 8)))
(def cupolone-est (struct2 (t 3 15) cil-cupolone cal-cupolone))
(def rect-puntale (t 3 31 (cuboi... |
d7383f24b5dbfcd72790a6e3cd917b17e83d8c1ae287d402ab67b5475c790c5f | alexkazik/qrcode | Mask.hs | # LANGUAGE BinaryLiterals #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Codec.QRCode.Code.Mask
( applyMask
, getPenaltyScore
) where
import Codec.QRCode.Base
import Control.Monad.Primitive (PrimMonad, PrimState)
import qualified Da... | null | https://raw.githubusercontent.com/alexkazik/qrcode/7ee12de893c856a968dc1397602a7f81f8ea2c68/qrcode-core/src/Codec/QRCode/Code/Mask.hs | haskell | | Apply the mask to the image, modules marked for functions are excluded.
draw format information
select correct mask
iterate over all modules
when it's not a function module and the mask tells to invert, do it
| Calculate the penalty score for an image
Adjacent modules in row having same color
Adjacent modules... | # LANGUAGE BinaryLiterals #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Codec.QRCode.Code.Mask
( applyMask
, getPenaltyScore
) where
import Codec.QRCode.Base
import Control.Monad.Primitive (PrimMonad, PrimState)
import qualified Da... |
9b848b7ee0297eb90e2629f73b197843271eb80ff6966b023a6fb308864403af | alanz/ghc-exactprint | RAE_T32b.hs | # LANGUAGE TemplateHaskell , TypeFamilies , GADTs , DataKinds , PolyKinds ,
RankNTypes , TypeOperators , TypeInType #
RankNTypes, TypeOperators, TypeInType #-}
module RAE_T32b where
import Data.Kind
data family Sing (k :: *) :: k -> *
data TyArr (a :: *) (b :: *) :: *
type family (a :: T... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/pre-ghc86/RAE_T32b.hs | haskell | # LANGUAGE TemplateHaskell , TypeFamilies , GADTs , DataKinds , PolyKinds ,
RankNTypes , TypeOperators , TypeInType #
RankNTypes, TypeOperators, TypeInType #-}
module RAE_T32b where
import Data.Kind
data family Sing (k :: *) :: k -> *
data TyArr (a :: *) (b :: *) :: *
type family (a :: T... | |
e452ff8b92ba68a6d707d86475328bc5d7d3bce0dc5e8d40454dce81d9183b33 | zclj/replication-packages | responses.clj | (ns openapi-pbt.responses
(:require [clojure.spec.alpha :as s]))
(defn response-to-spec
[response]
(when (and (= (get-in response [:schema :type]) "array")
(get-in response [:schema :items :$ref]))
(let [object-name (name (:spec response))]
`(s/def ~(:spec response) (s/coll-of ~(keyword "d... | null | https://raw.githubusercontent.com/zclj/replication-packages/8a5cb02e4fdda74107b5dcc34cbfa5cb5ae34dcf/ICST-2020/src/openapi_pbt/responses.clj | clojure | (ns openapi-pbt.responses
(:require [clojure.spec.alpha :as s]))
(defn response-to-spec
[response]
(when (and (= (get-in response [:schema :type]) "array")
(get-in response [:schema :items :$ref]))
(let [object-name (name (:spec response))]
`(s/def ~(:spec response) (s/coll-of ~(keyword "d... | |
635c6ab20a67c3e0c843f94a5d68f58d1e54d976c840dd27829e59130f90475e | haskell-repa/repa | Generate.hs |
module Data.Array.Repa.Flow.Seq.Operator.Generate
( generate_i
, enumFromN_i
, replicate_i
, replicates_bi)
where
import Data.Array.Repa.Bulk.Elt
import Data.Array.Repa.Flow.Seq.Source
import Data.Array.Repa.Flow.Seq.Base
import qualified Data.Array.Repa.Flow.Seq.Report as R
impo... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/icebox/abandoned/repa-flow/Data/Array/Repa/Flow/Seq/Operator/Generate.hs | haskell | -----------------------------------------------------------------------------
| Construct a flow of the given length by applying a function to each index.
Like `flow`, but with a different `Report`.
-----------------------------------------------------------------------------
| Yield a vector containing values @x... |
module Data.Array.Repa.Flow.Seq.Operator.Generate
( generate_i
, enumFromN_i
, replicate_i
, replicates_bi)
where
import Data.Array.Repa.Bulk.Elt
import Data.Array.Repa.Flow.Seq.Source
import Data.Array.Repa.Flow.Seq.Base
import qualified Data.Array.Repa.Flow.Seq.Report as R
impo... |
a82cb36c3fdad017468c2f1b8877ba4c4af6b70de8666062c0eef5b4067eb9d4 | ocaml-ppx/ocamlformat | module.ml | module AAAAAAAAAAAAAAAAAAA =
Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod
let _ =
let module A = B in
let module AAAAAAAAAAAAAAAAAAA =
Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod
in
t
let create (type a b) t i w p =
let module T = (val (t : (a, b) t)) in
T.create i w p... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/f14d3a24c9507b58832ca814c338c3df3a55d098/test/passing/tests/module.ml | ocaml | a
a
xxx
xxx
xxx
xxx
struct type z = K.y end
aa
bb
cc
dd
ee
ff
aa
bb
cc
dd
ee
ff | module AAAAAAAAAAAAAAAAAAA =
Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod
let _ =
let module A = B in
let module AAAAAAAAAAAAAAAAAAA =
Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod
in
t
let create (type a b) t i w p =
let module T = (val (t : (a, b) t)) in
T.create i w p... |
208d20a1627e2eb2ba294688a99a263cf1758a3f1b30d01d94392406459ee55c | input-output-hk/cardano-ledger | NonIntegral.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE PartialTypeSignatures #
{-# LANGUAGE TypeSynonymInstances #-}
module Tests.Cardano.Ledger.NonIntegral where
import Cardano.Ledger.NonIntegral
import qualified Data.Fixed as FP
import Test.QuickCheck
data E34
instance FP.HasResolution E34 where
resolution _ = 10 ^ (34 :: I... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/6546efbda1cc08394543cc335404134e05c33829/libs/non-integral/test/Tests/Cardano/Ledger/NonIntegral.hs | haskell | # LANGUAGE TypeSynonymInstances #
| Normalizes the integers, return a pair of integers, such that:
----------------------
----------------------
-------------------------------------
FixedPoint Versions of Properties --
-------------------------------------
---------------------------------
Double Versions of Prope... | # LANGUAGE FlexibleInstances #
# LANGUAGE PartialTypeSignatures #
module Tests.Cardano.Ledger.NonIntegral where
import Cardano.Ledger.NonIntegral
import qualified Data.Fixed as FP
import Test.QuickCheck
data E34
instance FP.HasResolution E34 where
resolution _ = 10 ^ (34 :: Int)
type FixedPoint = FP.Fixed E34
e... |
577db50e4677d9170a179b8d508905bd8594319fda5f6c882b1fa489cfc8d8cf | drewt/scmus | option.scm | ;;
Copyright 2014 - 2020
;;
;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in ... | null | https://raw.githubusercontent.com/drewt/scmus/5041ec376cb17db463117b8fa212b16b23fe770d/test/option.scm | scheme |
This program is free software; you can redistribute it and/or
either version 2 of the
License, or (at your option) any later version.
This program 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 PURPOS... | Copyright 2014 - 2020
modify it under the terms of the GNU General Public License as
You should have received a copy of the GNU General Public License
(include "test/test.scm")
(declare (unit test/option)
(uses option
event))
(import scmus.option
scmus.event)
(start-test "opti... |
83f910b66acc719d8aeb315796b6077bc72e412439802720b04270c93c2850e1 | fpco/ide-backend | CCompiler.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.CCompiler
Copyright : 2011 ,
--
-- Maintainer :
-- Portability : portable
--
-- This simple package provides types and functions for interacting with
-- C compilers. Currently it's just... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.18.1.5/Distribution/Simple/CCompiler.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Simple.CCompiler
Maintainer :
Portability : portable
This simple package provides types and functions for interacting with
C compilers. Currently it's just a type enumerating extant C-like
languages, ... | Copyright : 2011 ,
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are
met :
* Redistributions of source code must retain the above copyright
notice , this list of conditions and the following disclaim... |
3e18f77ab0e902fd6de1809d3c4b5a91359fb230d78c8931819c4b6a2dda4dbb | albertoruiz/easyVision | testwebcam.hs | import Vision.GUI.Simple
import qualified OpenCV
cam = OpenCV.webcam "/dev/video1" (Size 600 800) 30
main = do
runT_ cam (observe "source" id >>> freqMonitor)
| null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/opencv/testwebcam.hs | haskell | import Vision.GUI.Simple
import qualified OpenCV
cam = OpenCV.webcam "/dev/video1" (Size 600 800) 30
main = do
runT_ cam (observe "source" id >>> freqMonitor)
| |
7173df675af4caa173ea3aabb7ceeb8ad6b2439bc31c11792f72a4d1bb8eb2eb | techascent/tech.ml.dataset | parquet.clj | (ns tech.v3.libs.parquet
"Support for reading Parquet files. You must require this namespace to
enable parquet read/write support.
Supported datatypes:
* all numeric types
* strings
* java.time LocalDate, Instant
* UUIDs (get read/written as strings in accordance to R's write_parquet function)
Parsi... | null | https://raw.githubusercontent.com/techascent/tech.ml.dataset/63c302251b9624def3b978955cac032a370da5c7/src/tech/v3/libs/parquet.clj | clojure | The user specified a specific parser for this datatype
able to save to nippy
We clear the old missing set because that was taken care of above.
and select, when it has a missing set, has to go index by index and
make a new missing set.
handle repetitions
unwrap url if exists
get canonical path
make a path out of it
fro... | (ns tech.v3.libs.parquet
"Support for reading Parquet files. You must require this namespace to
enable parquet read/write support.
Supported datatypes:
* all numeric types
* strings
* java.time LocalDate, Instant
* UUIDs (get read/written as strings in accordance to R's write_parquet function)
Parsi... |
59e5f7a5a0254b7572cacaac5d3cce8fa001a9a50a5e66e43f58b775671aca00 | lgessler/fulcro-material-ui-template | projects_page.cljs | (ns fmuit.client.ui.project.projects-page
(:require [com.fulcrologic.fulcro.components :as c :refer [defsc]]
[com.fulcrologic.fulcro.data-fetch :as df]
[fmuit.client.router :as r]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.dom :as do... | null | https://raw.githubusercontent.com/lgessler/fulcro-material-ui-template/efc36f25675de10800f63274616a8ff42d08f088/src/main/fmuit/client/ui/project/projects_page.cljs | clojure | (ns fmuit.client.ui.project.projects-page
(:require [com.fulcrologic.fulcro.components :as c :refer [defsc]]
[com.fulcrologic.fulcro.data-fetch :as df]
[fmuit.client.router :as r]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.dom :as do... | |
8c558153b0f16440e4ea913222b12625eee8cb7fa93595dc8dc6a8074fadd60b | andrewmcloud/consimilo | minhash_util_test.clj | (ns consimilo.minhash-util-test
(:require [clojure.test :refer :all]
[consimilo.minhash-util :refer :all])
(:import (clojure.lang BigInt)))
(defn bigint_vec
[n val]
(repeat n (bigint val)))
(def big-coll-1 (bigint_vec 3 3))
(def big-coll-2 (bigint_vec 3 10))
(def big-coll-3 [(bigint 3) (bigint 3) ... | null | https://raw.githubusercontent.com/andrewmcloud/consimilo/db96c1695248c3486e1d23de5589b39f0e0bd49f/test/consimilo/minhash_util_test.clj | clojure | (ns consimilo.minhash-util-test
(:require [clojure.test :refer :all]
[consimilo.minhash-util :refer :all])
(:import (clojure.lang BigInt)))
(defn bigint_vec
[n val]
(repeat n (bigint val)))
(def big-coll-1 (bigint_vec 3 3))
(def big-coll-2 (bigint_vec 3 10))
(def big-coll-3 [(bigint 3) (bigint 3) ... | |
b345b4ed6f004f523255d5d43ef5d9beb600dd2cd1f50d0b782716a2fe8c3c1e | potapenko/playphraseme-site | create_user.clj | (ns playphraseme.api.route-functions.user.create-user
(:require [buddy.hashers :as hashers]
[clojure.string :as string]
[playphraseme.api.queries.user.registered-user :as users]
[playphraseme.api.queries.user.user-permission :as user-prm]
[ring.util.http-response :as re... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/api/route_functions/user/create_user.clj | clojure | (ns playphraseme.api.route-functions.user.create-user
(:require [buddy.hashers :as hashers]
[clojure.string :as string]
[playphraseme.api.queries.user.registered-user :as users]
[playphraseme.api.queries.user.user-permission :as user-prm]
[ring.util.http-response :as re... | |
696b373a47d50562256ab2d17c6d933fae921963517a73f7ee674d8c124a84f3 | ghc/packages-dph | Delaunay.hs | {-# LANGUAGE PArr #-}
{-# OPTIONS -fvectorise #-}
module Delaunay ( delaunay, delaunayPoints ) where
import Types
import Hull
import Sort
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double
import qualified Data.Array.Parallel.Prelude.Int as Int
import Data.Array.Parallel.Prelude.Int ( Int )... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/icebox/examples/delaunay/Delaunay.hs | haskell | # LANGUAGE PArr #
# OPTIONS -fvectorise #
this makes it so that we alternate between
this makes it so that we alternate between |
module Delaunay ( delaunay, delaunayPoints ) where
import Types
import Hull
import Sort
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double
import qualified Data.Array.Parallel.Prelude.Int as Int
import Data.Array.Parallel.Prelude.Int ( Int )
import qualified Prelude as P
xOf :: IPoint -> ... |
0a8c774d10d2d84c9a380f67b3404fae212b05bd13715c905775b201e373cf01 | lispbuilder/lispbuilder | bitmap-font-data-7x13b.lisp |
(in-package #:lispbuilder-sdl)
(defparameter *7x13B-font-data*
#(0 84 84 0 68 68 0 68 68 0 84 84 0 0 0 0 0 0 48 120 252 120 48 0 0 0 84 170 84
170 84 170 84 170 84 170 84 170 84 0 216 216 248 216 216 0 60 24 24 24 24 0 0
240 192 224 192 192 0 60 48 56 48 48 0 0 112 192 192 192 112 0 56 52 56 52 52
... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/sdl/bitmap-font-data-7x13b.lisp | lisp |
(in-package #:lispbuilder-sdl)
(defparameter *7x13B-font-data*
#(0 84 84 0 68 68 0 68 68 0 84 84 0 0 0 0 0 0 48 120 252 120 48 0 0 0 84 170 84
170 84 170 84 170 84 170 84 170 84 0 216 216 248 216 216 0 60 24 24 24 24 0 0
240 192 224 192 192 0 60 48 56 48 48 0 0 112 192 192 192 112 0 56 52 56 52 52
... | |
d748bc1b4029645abd496069f2d2aa2ac26463da1dc20727a43d159f71194002 | input-output-hk/cardano-ledger-byron | Constants.hs | -- | Non-configurable constants
For configurable constants , see Cardano . Genesis . Configuration .
module Cardano.Chain.Constants
( sharedSeedLength
)
where
import Cardano.Prelude
--------------------------------------------------------------------------------
-- Constants which are not configurable
------... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/src/Cardano/Chain/Constants.hs | haskell | | Non-configurable constants
------------------------------------------------------------------------------
Constants which are not configurable
------------------------------------------------------------------------------
| Length of shared seed. | For configurable constants , see Cardano . Genesis . Configuration .
module Cardano.Chain.Constants
( sharedSeedLength
)
where
import Cardano.Prelude
sharedSeedLength :: Integral a => a
sharedSeedLength = 32
|
490d2fafc9716b62c676ce386e1190e0a7eae06330a2afad732ea662dce25e3d | argp/bap | custom_ulexing.ml | (* This example shows how to use ulex with a custom implementation
for lex buffers. *)
module Ulexing =
struct
exception Error
type t = {
buf : string;
mutable pos : int;
mutable mark_pos : int;
mutable mark_val : int;
mutable start : int;
}
let from_immutable_string s =
{ buf = s;... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/custom_ulexing.ml | ocaml | This example shows how to use ulex with a custom implementation
for lex buffers. |
module Ulexing =
struct
exception Error
type t = {
buf : string;
mutable pos : int;
mutable mark_pos : int;
mutable mark_val : int;
mutable start : int;
}
let from_immutable_string s =
{ buf = s; pos = 0; mark_pos = 0; mark_val = 0; start = 0 }
let start b =
b.mark_pos <- b.pos... |
844faa506d9fdb87593e35520928b21e48ff8e88c1b3e3a11cb3c01746505c3a | forked-from-1kasper/bravo | repl.ml | open Module
open Error
open Decl
open Elab
open Expr
let help =
"Available commands:
<statement> infer type and normalize statement
:q quit
:r restart
:h display this message"
let init : state = empty
let st : state ref = ref init
let checkAndEval ctx e : value * value ... | null | https://raw.githubusercontent.com/forked-from-1kasper/bravo/a78d7ec01db94a5173045a6930c1c76a5e7fcd86/repl.ml | ocaml | open Module
open Error
open Decl
open Elab
open Expr
let help =
"Available commands:
<statement> infer type and normalize statement
:q quit
:r restart
:h display this message"
let init : state = empty
let st : state ref = ref init
let checkAndEval ctx e : value * value ... | |
ce2db9d4fc344bc717b3fb752d57fd32dc1081c71f90a5b32998c4b53863d559 | scmlab/gcl | Explanation.hs | {-# LANGUAGE OverloadedStrings #-}
module GCL.WP.Explanation where
import Data.Loc
import Data.Text (Text)
import Syntax.Abstract
import Syntax.Common ( Name(..) )
import GCL.Predicate
import Render
emptyExplain :: Text -> Loc -> Origin
emptyExplain title l = Explain
{ originHeader ... | null | https://raw.githubusercontent.com/scmlab/gcl/3d3aefb513ce6d3821265d77b6f3f0ffba0f4c66/src/GCL/WP/Explanation.hs | haskell | # LANGUAGE OverloadedStrings # |
module GCL.WP.Explanation where
import Data.Loc
import Data.Text (Text)
import Syntax.Abstract
import Syntax.Common ( Name(..) )
import GCL.Predicate
import Render
emptyExplain :: Text -> Loc -> Origin
emptyExplain title l = Explain
{ originHeader = title
, originExplanat... |
c41a3d43a896a156677931419a8813668c84b1856b723437b1ab95ab891066cb | ocaml-multicore/lockfree | lockfree.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... | null | https://raw.githubusercontent.com/ocaml-multicore/lockfree/bf8f5000a6e802b4a21a6cfbf8ec8aa5208a8612/src/lockfree.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... | |
1113214fc136f29d061bebc83a83ee56f4b7b770e0d77589f4308c27350267a8 | ktakashi/sagittarius-scheme | tab.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; win32/gui/tab.scm - Win32 Tab component
;;;
Copyright ( c ) 2021 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Red... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/c1cdf8abe9e625af90731724a5e495bfebeab2c1/ext/ffi/win32/gui/tab.scm | scheme | coding : utf-8 ; -*-
win32/gui/tab.scm - Win32 Tab component
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list ... | Copyright ( c ) 2021 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!nounbound
(library (win32 gui tab)
(export ma... |
4ee2819f8d5323ee24e816e10b1341eff4172dd59499300e700521a76a878e7d | mransan/btree | dbtlk_table.ml |
The MIT License ( MIT )
Copyright ( c ) 2016 ( )
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 ,... | null | https://raw.githubusercontent.com/mransan/btree/530cadca4d1569fc0a638d9fdbb1bd962fd8e171/src/dbtlk_table.ml | ocaml | * [to_bytes t] encodes [t] to bytes
* [of_bytes bytes] decodes a value of type [t] from [bytes]
* [to_string t] returns a string for debugging purposes only
* {2 Indices}
* [index1 t] access the key1 for a given record
Record_sig
... then the record itself |
The MIT License ( MIT )
Copyright ( c ) 2016 ( )
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 ,... |
281506c386710a141b7eeaa798b84dafed9dbcbcf3815fa72ec31d7d70221d8e | ddssff/refact-global-hse | Tableaux.hs | | Tableaux , seen as an optimized version of a Prawitz - like procedure .
--
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
{-# LANG... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/tests/input/atp-haskell/Data/Logic/ATP/Tableaux.hs | haskell |
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeSynonymInstances #
| Unify complementary literals.
| Unify and refute a set of disjuncts.
-------------------------------------------------------------------------
Examples.
---------------------------------------------------... | | Tableaux , seen as an optimized version of a Prawitz - like procedure .
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE ScopedTypeVariables #
#... |
074cf7836d3ccdd22b73e8a0b6fcb8650f1edb2a68f412b3668bd07c85eb6c61 | binaryage/cljs-devtools | issue54.cljs | (ns devtools-sample.tests.issue54
(:require-macros [devtools-sample.logging :refer [log info]])
(:require [devtools-sample.boot :refer [boot!]]))
(boot! "/src/tests/devtools_sample/tests/issue54.cljs")
(enable-console-print!)
; --- MEAT STARTS HERE -->
(js/console.log ##NaN ##Inf ##-Inf)
(js/console.log [##NaN #... | null | https://raw.githubusercontent.com/binaryage/cljs-devtools/d07fc6d404479b1ddd32cecc105009de77e3cba7/examples/lein/src/tests/devtools_sample/tests/issue54.cljs | clojure | --- MEAT STARTS HERE -->
<-- MEAT STOPS HERE --- | (ns devtools-sample.tests.issue54
(:require-macros [devtools-sample.logging :refer [log info]])
(:require [devtools-sample.boot :refer [boot!]]))
(boot! "/src/tests/devtools_sample/tests/issue54.cljs")
(enable-console-print!)
(js/console.log ##NaN ##Inf ##-Inf)
(js/console.log [##NaN ##Inf ##-Inf])
|
a1e966960ef582be6669747a9af54d388631f5194c0e411d4c4267f91331a4b7 | tek/polysemy-hasql | EncoderValue.hs | module Polysemy.Hasql.Table.EncoderValue where
import qualified Data.Aeson as Aeson
import Hasql.Encoders (Value, enum, jsonBytes)
import Polysemy.Db.Data.Rep (Enum, Json, Prim)
import Polysemy.Db.SOP.Constraint (ConstructNt, constructNt)
import Polysemy.Db.Tree.Data.Effect (Newtype)
import Prelude hiding (Enum, bool)... | null | https://raw.githubusercontent.com/tek/polysemy-hasql/e1ed71cacf6f329ee1428c3012d582c9eb6cf497/packages/hasql/lib/Polysemy/Hasql/Table/EncoderValue.hs | haskell | module Polysemy.Hasql.Table.EncoderValue where
import qualified Data.Aeson as Aeson
import Hasql.Encoders (Value, enum, jsonBytes)
import Polysemy.Db.Data.Rep (Enum, Json, Prim)
import Polysemy.Db.SOP.Constraint (ConstructNt, constructNt)
import Polysemy.Db.Tree.Data.Effect (Newtype)
import Prelude hiding (Enum, bool)... | |
f3cbcb9fddd8d864af7bdbf518a2c14cede8a8517a9fd3ee5b09eb03d0a3dfab | hellonico/origami | project.clj | (let [properties (select-keys (into {} (System/getProperties)) ["os.name"])
platform (apply format "%s" (vals properties))
-is-an-elegant-way-to-set-up-a-leiningen-project-that-requires-different-dep
mxnet (case platform
"Mac OS X" '[org.apache.mxnet.contrib.clojure/clojure-mxnet-osx-cpu "1... | null | https://raw.githubusercontent.com/hellonico/origami/a1ebd65b857b5bd7414ca079f4cfb17cfed6146b/project.clj | clojure | _ (println (str platform mxnet))
["deploy" "vendredi"]
testing
~mxnet
used for api code only
[org.clojure/clojure "1.10.0"] | (let [properties (select-keys (into {} (System/getProperties)) ["os.name"])
platform (apply format "%s" (vals properties))
-is-an-elegant-way-to-set-up-a-leiningen-project-that-requires-different-dep
mxnet (case platform
"Mac OS X" '[org.apache.mxnet.contrib.clojure/clojure-mxnet-osx-cpu "1... |
da89eb1f73e3fa78eea71e15dd801828b02bf71290c0baaeb47f6b482f236c2e | russ/openpoker | dmb.erl | Copyright ( C ) 2005 - 2008 Wager Labs , SA
%%%%
%%%% THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS
%%%% PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF
%%%% THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICE... | null | https://raw.githubusercontent.com/russ/openpoker/62edd72a35b9ef52f55da9303cf1e06142e95895/src/dmb.erl | erlang |
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF
THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT
LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT
AND AGREE TO BE BOUND BY THE TERM... | Copyright ( C ) 2005 - 2008 Wager Labs , SA
CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS
-nc-sa/3.0/us/
-module(dmb).
-export([run/3, run/4, test/1, test/2, test/3,
debug/1, setup/0, cleanup/0, procs/0]).
-include("ircdb.hrl").
-include("common.hrl").
-include("schema.hrl... |
460f55a835f33c86f1e961a4f40a24c6e555e7a9c191f11d5248c9dce7562ac5 | mirage/irmin | trace_collection.ml |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | null | https://raw.githubusercontent.com/mirage/irmin/9bcce092a500e7e7e88dab3e0240091488e46abe/bench/irmin-pack/trace_collection.ml | ocaml | * Make state trace collector.
* Imperative stat trace collector. It is optimised to minimise the CPU
footprint.
No oldie after a newies |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... |
b5c998371bde4eca63aa56437ef0c1f1927bf5efa30b0911cf4caa4d182c4fbd | ocaml/odoc | types.ml | type break_hierarchy = Aesthetic | Simple | Line | Paragraph | Separation
type row_size =
| Empty
| Small (** text only *)
| Large (** No table *)
| Huge (** tables **)
type elt =
| Txt of string list
| Section of section
| Verbatim of string
| Internal_ref of reference
| External_ref of string *... | null | https://raw.githubusercontent.com/ocaml/odoc/2f639d7d661bc5397afce83dfaa71af53d2a8677/src/latex/types.ml | ocaml | * text only
* No table
* tables * | type break_hierarchy = Aesthetic | Simple | Line | Paragraph | Separation
type row_size =
| Empty
type elt =
| Txt of string list
| Section of section
| Verbatim of string
| Internal_ref of reference
| External_ref of string * t option
| Label of string
| Raw of string
| Tag of string * t
| Style ... |
d01cdf9849f6efe1bb2b1340a7ecbe32a49946891e4ea10df9b9bb208c63e5f6 | ahrefs/atd | atdgen.ml | [@@@deprecated "The runtime for Atdgen is now the module Atdgen_runtime existing
in the atdgen-runtime opam package"]
include Atdgen_runtime
| null | https://raw.githubusercontent.com/ahrefs/atd/9a3cb984a695563c04b41cdd7a1ce9454eb40e1c/atdgen/src/deprecated/atdgen.ml | ocaml | [@@@deprecated "The runtime for Atdgen is now the module Atdgen_runtime existing
in the atdgen-runtime opam package"]
include Atdgen_runtime
| |
f84f21bbe48a0c494a671342c90beb361b7774c7e9d9b1e514bc4e68ed18d248 | zwizwa/rai | main_lv2.rkt | #lang racket/base
uses TTL files in Turtle RDF format to encode a nesting of
;; lists, dictionaries and atomic values.
;;
/
;; :Turtle_RDF
;;
( FIXME : It might be best to use 3rd party code instead :
;; -librdf/docs/rdf.html )
;;
;;
;; The basic format is simple:
;; {subject} {relationship} {object}
;;
The ... | null | https://raw.githubusercontent.com/zwizwa/rai/6bcacb7da4172971816027fd88a0209adbd60e30/main_lv2.rkt | racket | lists, dictionaries and atomic values.
:Turtle_RDF
-librdf/docs/rdf.html )
The basic format is simple:
{subject} {relationship} {object}
meaning and attributes. URLs can be shortened using a prefix
method where symbols represent URL prefixes.
What makes the format hard is the arcane ways of making a file... | #lang racket/base
uses TTL files in Turtle RDF format to encode a nesting of
/
( FIXME : It might be best to use 3rd party code instead :
The first two are URLs pointing to an XML document describing the
position , and contains a one or more { relationship } { object }
is between these two forms :
... |
6f22524b97ff6b3e8a4316e6f96ad45b57ded65c44ae26eea997eb831bb5d6d3 | input-output-hk/cardano-ledger | AlonzoEraGen.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
| AlonzoEra instances for EraGen and... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/49a84725c4c2ecabc80f6dac215881bc23920962/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
============================================================
collateral -- TODO do something better here ( use genenv ? )
(ValidityInterval SNothing SNothing) -- (ValidityInterval low high)
reqSignerHashes
scriptIntegrityHash starts out with empty Redeemers,... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
| AlonzoEra instances for EraGen and ScriptClass
module Test.Cardano.Ledger.Alonzo.AlonzoEraGen where... |
00f9e833174ba4739f47dedd705d815b82a35f65ac2594498b4b8a7c938ffb3b | mirage/ocaml-tuntap | nonblock_test.ml | open Printf
open Lwt
open Lwt_unix
let test () =
(* open tun *)
let fd, name = Tuntap.opentun ~devname:"tap0" () in
printf "parent open: %s\n" name;
let _lfd = of_unix_file_descr fd ~blocking:false in
sleep 0.1
let () = Lwt_main.run (sleep 0.1 >>= test)
| null | https://raw.githubusercontent.com/mirage/ocaml-tuntap/2b377e4a44686aad23ecfdede41bd6902a26de6b/test/nonblock_test.ml | ocaml | open tun | open Printf
open Lwt
open Lwt_unix
let test () =
let fd, name = Tuntap.opentun ~devname:"tap0" () in
printf "parent open: %s\n" name;
let _lfd = of_unix_file_descr fd ~blocking:false in
sleep 0.1
let () = Lwt_main.run (sleep 0.1 >>= test)
|
e2ccf62acc133b1849a141a73add9a53b6a516d511bbda8e1403c60a9d6b5f83 | adampalay/SKITypes | skiValue.hs | # OPTIONS_GHC -Wall #
import Data.Foldable
main :: IO ()
main = do
let terms =
[I, I] :
[K, A, B] :
[S, Group [K, Group [S, I]], K, A, B] :
-- [S, I, I, Group [S, I, I]] :
[]
forM_ terms $ \ term -> do
print term
putStrLn "==>"
print $ reduce term
putStrLn "... | null | https://raw.githubusercontent.com/adampalay/SKITypes/cfe0fe134caf34d039930b71aa90c8b1ea2c6d8a/skiValue.hs | haskell | [S, I, I, Group [S, I, I]] :
I pattern matching
K pattern matching
S pattern matching
group reduction
if there's another symbol on the left, leave it and reduce the rest of the | # OPTIONS_GHC -Wall #
import Data.Foldable
main :: IO ()
main = do
let terms =
[I, I] :
[K, A, B] :
[S, Group [K, Group [S, I]], K, A, B] :
[]
forM_ terms $ \ term -> do
print term
putStrLn "==>"
print $ reduce term
putStrLn "======================"
data Element = ... |
7924f14459abd863841cdde15e830d50138ac885e1700469f10538f49773d8fc | scarvalhojr/haskellbook | section30.4.hs |
import System.Environment (getArgs)
import Control.Exception (ArithException, try, catch)
willIFail :: Integer -> IO (Either ArithException ())
willIFail denom = try $ print $ div 5 denom
---
onlyReportError :: Show e => IO (Either e a) -> IO ()
onlyReportError action = do
result <- action
case result of
L... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter30/section30.4.hs | haskell | -
- |
import System.Environment (getArgs)
import Control.Exception (ArithException, try, catch)
willIFail :: Integer -> IO (Either ArithException ())
willIFail denom = try $ print $ div 5 denom
onlyReportError :: Show e => IO (Either e a) -> IO ()
onlyReportError action = do
result <- action
case result of
Left ... |
e289a73784c2d2567ca25e64b47dacabf691afe90b1e4bba2fac6d26fc77f663 | input-output-hk/nix-tools | CLI.hs | module Plan2Nix.CLI
( Args(..)
, parsePlan2NixArgs
) where
import Options.Applicative hiding (option)
import Data.Semigroup ((<>))
import Cabal2Nix (CabalDetailLevel(..))
--------------------------------------------------------------------------------
-- CLI Arguments
data Args = Args
{ argOutputDir :: FilePa... | null | https://raw.githubusercontent.com/input-output-hk/nix-tools/c9c10ab889a7b7f2f5f4bb71e8786fc01d49e53e/plan2nix/Plan2Nix/CLI.hs | haskell | ------------------------------------------------------------------------------
CLI Arguments
Argument Parser | module Plan2Nix.CLI
( Args(..)
, parsePlan2NixArgs
) where
import Options.Applicative hiding (option)
import Data.Semigroup ((<>))
import Cabal2Nix (CabalDetailLevel(..))
data Args = Args
{ argOutputDir :: FilePath
, argPlanJSON :: FilePath
, argCabalProject :: FilePath
, argCacheFile :: FilePath
, ar... |
e211f1486544ae7b6df2bbb81e0ef4d5c4b04849c76770ef260ae8082cfaacb8 | vyzo/gerbil | core__8.scm | (declare (block) (standard-bindings) (extended-bindings) (inlining-limit 200))
(begin
(define |gerbil/core$<MOP>$<MOP:3>[1]#macro-object::t|
(make-class-type
'gerbil.core#macro-object::t
'()
'(macro)
'macro-object
'()
'#f))
(define |gerbil/core$<MOP>$<MOP:3>[1]#macro-object?|
(... | null | https://raw.githubusercontent.com/vyzo/gerbil/17fbcb95a8302c0de3f88380be1a3eb6fe891b95/src/bootstrap/gerbil/core__8.scm | scheme | (declare (block) (standard-bindings) (extended-bindings) (inlining-limit 200))
(begin
(define |gerbil/core$<MOP>$<MOP:3>[1]#macro-object::t|
(make-class-type
'gerbil.core#macro-object::t
'()
'(macro)
'macro-object
'()
'#f))
(define |gerbil/core$<MOP>$<MOP:3>[1]#macro-object?|
(... | |
05f2b3612d2e57b7d5658e6bd3f090b4828c47d85e46c76c3127e5edd95456e3 | philnguyen/soft-contract | issue-67.rkt | #lang racket
(define rx #rx"a regex")
(define px #px"a pregex")
(define brx #rx#"a byte-regex")
(define bpx #px#"a byte-pregex")
(define rx1 rx)
(define n 42)
(provide
(contract-out
[rx regexp?]
[px pregexp?]
[brx byte-regexp?]
[bpx byte-pregexp?]
[rx1 (not/c integer?)]
[n (not/c regexp?)]))
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/issues/issue-67.rkt | racket | #lang racket
(define rx #rx"a regex")
(define px #px"a pregex")
(define brx #rx#"a byte-regex")
(define bpx #px#"a byte-pregex")
(define rx1 rx)
(define n 42)
(provide
(contract-out
[rx regexp?]
[px pregexp?]
[brx byte-regexp?]
[bpx byte-pregexp?]
[rx1 (not/c integer?)]
[n (not/c regexp?)]))
| |
5472eab83126d436ef0efc25d4f6fe0de546e69ec929b8dd439b3ddc8b3bd385 | factisresearch/mq-demo | LogWriter.hs | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE DeriveDataTypeable #-}
module Mgw.Util.Logging.LogWriter
( setupLoggingWithConfig, setupLoggingWithConfigAndErrorHook, setupLogging
, setupLoggingWithLevel, teardownLogging
, startLoggingThread, getDynamicLogConfig, setDynamicLogConfig, isLoggin... | null | https://raw.githubusercontent.com/factisresearch/mq-demo/0efa1991ca647a86a8c22e516a7a1fb392ab4596/server/src/lib/Mgw/Util/Logging/LogWriter.hs | haskell | # LANGUAGE DeriveDataTypeable #
--------------------------------------
SITE-PACKAGES
--------------------------------------
--------------------------------------
LOCAL
--------------------------------------
disable logging of new messages
wait until all log messages have been taken out
# SCC "printLogMessage/Loggi... | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
module Mgw.Util.Logging.LogWriter
( setupLoggingWithConfig, setupLoggingWithConfigAndErrorHook, setupLogging
, setupLoggingWithLevel, teardownLogging
, startLoggingThread, getDynamicLogConfig, setDynamicLogConfig, isLoggingActive
, withDynamicLogConfig, ... |
57b117426a2820b32fb927e19668752a8950d4a6de9284ec482bc28d22ac0ecf | clojure-interop/aws-api | Headers.clj | (ns com.amazonaws.services.s3.Headers
"Common S3 HTTP header values used throughout the AWS S3 Java client."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.s3 Headers]))
| null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.s3/src/com/amazonaws/services/s3/Headers.clj | clojure | (ns com.amazonaws.services.s3.Headers
"Common S3 HTTP header values used throughout the AWS S3 Java client."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.s3 Headers]))
| |
cc19caf41cc711789c59aaa6cb453c2aa245926706f5350c6b7108f057505042 | JoeKennedy/fantasy | Transaction.hs | module Handler.League.Transaction where
import Import
import Handler.League.Layout
import qualified Database.Esqueleto as E
import Database.Esqueleto ((^.), (?.))
import qualified Data.List as List (cycle)
import Data.Maybe (fromJust)
import Text.Blaze (toMarkup... | null | https://raw.githubusercontent.com/JoeKennedy/fantasy/eb9dc9bf6074be5c5ca951e323c6497676424dda/Handler/League/Transaction.hs | haskell | ---------
Types --
---------
---------
Forms --
---------
----------
Routes --
----------
-----------
Widgets --
-----------
------------------
Widget Helpers --
------------------
-----------
Queries --
-----------
-----------------------
Create Transactions --
-----------------------
-------------------------
... | module Handler.League.Transaction where
import Import
import Handler.League.Layout
import qualified Database.Esqueleto as E
import Database.Esqueleto ((^.), (?.))
import qualified Data.List as List (cycle)
import Data.Maybe (fromJust)
import Text.Blaze (toMarkup... |
ebae6a867e55c428466833e962b24e22bfc71b5bdcdae15fb7dc1226720ae7e0 | ygmpkk/house | ExceptionTests.hs | import Unstable.Control.Monad.Transformers
test2' _ = tell "1" >> throwError '2' >> return ()
test3' _ = put 1 >> throwError 2 >> return ()
test2 = do print =<< (runError $ runWriter $ test2' ())
print =<< (runWriter $ runError $ test2' ())
test3 = do print =<< (runError $ runStateS 7 $ test... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/monads/Unstable/Control/Monad/tests/ExceptionTests.hs | haskell | import Unstable.Control.Monad.Transformers
test2' _ = tell "1" >> throwError '2' >> return ()
test3' _ = put 1 >> throwError 2 >> return ()
test2 = do print =<< (runError $ runWriter $ test2' ())
print =<< (runWriter $ runError $ test2' ())
test3 = do print =<< (runError $ runStateS 7 $ test... | |
8cec8bcad53907c5268336a20d77b322cf2c2db09e836148475dfbe74deaccba | jbclements/sxml | lazy-xpath.rkt | #lang racket/base
(require racket/promise
(only-in racket/port call-with-input-string)
srfi/13/string
"ssax/sxpathlib.rkt"
"ssax/util.rkt"
srfi/2
"ssax/errors-and-warnings.rkt"
"sxpath-ext.rkt"
"xpath-parser.rkt"
"txpath.rkt"
"xpa... | null | https://raw.githubusercontent.com/jbclements/sxml/d3b8570cf7287c4e06636e17634f0f5c39203d52/sxml/lazy-xpath.rkt | racket |
This software is in Public Domain.
Please send bug reports and comments to:
Dmitry Lizorkin
nodes and promises in turn.
Specification. In particular, an attribute node must occur before any child
nodes, attribute value must be atomic, etc.
may be a promise. Such a nodeset with a promise as its last mem... | #lang racket/base
(require racket/promise
(only-in racket/port call-with-input-string)
srfi/13/string
"ssax/sxpathlib.rkt"
"ssax/util.rkt"
srfi/2
"ssax/errors-and-warnings.rkt"
"sxpath-ext.rkt"
"xpath-parser.rkt"
"txpath.rkt"
"xpa... |
614a62dd83eda90dae5d7355aeb0be335a4a957c8d66cc91b80187596a9e2e1d | rizo/snowflake-os | proc.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/ocamlopt.opt/asmcomp/hppa/proc.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
open Misc
open Cmm
open Reg
o... |
618760900ffbc17650a7de1a8e3fbc81291fa30f38fe060f9bf1dd442f48705f | Clozure/ccl | compile-hemlock.lisp | ;;;
;;; Copyright 2016 Clozure Associates
;;;
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, softw... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/cocoa-ide/compile-hemlock.lisp | lisp |
Copyright 2016 Clozure Associates
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... | distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
(defparameter *hemlock-src-dir-pathname* "ccl:cocoa-ide;hemlock;src;")
(defparameter *hemlock-binary-dir-pathname* "ccl:cocoa-ide;hemlock;bin;openmcl;")
(defparameter *hemlock-binary-file-extension*
(pathname-type (compile-f... |
e4d2b3c1ecf9f833c80ea1cba55d584f105315d0e1ef291ab7c9159c17a21e3a | ejgallego/coq-serapi | ser_vmvalues.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/61d2a5c092c1918312b8a92f43a374639d1786f9/serlib/ser_vmvalues.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 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright 2016 - 2017 MINES... |
748565ad25ec21f76711c9e1e925b04510d9f8e3ac79a1e8c966f962a24bd84a | danlarkin/subrosa | hooks.clj | (ns subrosa.hooks)
(defonce hooks (ref {}))
(def format-hook
(comp (memfn toLowerCase) str))
(defn get-hook [hook]
(let [hook (format-hook hook)]
(dosync
(if-let [hook-map (@hooks hook)]
hook-map
(do
(alter hooks assoc hook {})
{})))))
(defn add-hook [tag hook fn]
(dos... | null | https://raw.githubusercontent.com/danlarkin/subrosa/b8e554ffc1b83572acbbb8f50704d3db44b3770f/src/subrosa/hooks.clj | clojure | (ns subrosa.hooks)
(defonce hooks (ref {}))
(def format-hook
(comp (memfn toLowerCase) str))
(defn get-hook [hook]
(let [hook (format-hook hook)]
(dosync
(if-let [hook-map (@hooks hook)]
hook-map
(do
(alter hooks assoc hook {})
{})))))
(defn add-hook [tag hook fn]
(dos... | |
6566678ceb5b4863b30c620448063ee0cf2150be973e3f4c2f891aeacb8ae584 | facebook/flow | path.ml |
* 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/flow/c97027ca210274e13f65aa23027d95ee4020ee55/src/hack_forked/utils/sys/path.ml | ocaml | * [is_ancestor ~prefix path] determines if [prefix] is an ancestor directory of [path]
*
* Resolves a path (using realpath)
*
* The advantage of using a path instead of strings is that you
* don't need to care about symlinks or trailing slashes: each
* path gets normalized by calling realpath.
*
* A few things ... |
* 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... |
e034b01ad411ba5a1714f8f11a6c3b48f9346ab269103f654a51ab01a3795806 | fukamachi/psychiq | heartbeat.lisp | (in-package :cl-user)
(defpackage psychiq.launcher.heartbeat
(:use #:cl
#:psychiq.util)
(:import-from #:psychiq.connection
#:with-connection
#:connect
#:disconnect)
(:import-from #:psychiq.coder
#:encode-object)
(:import-from #:psychiq.laun... | null | https://raw.githubusercontent.com/fukamachi/psychiq/602fbb51d4c871de5909ec0c5a159652f4ae9ad3/src/launcher/heartbeat.lisp | lisp | Don't lose the counts if there was a network issue
XXX: this should actually send the signal "signal-to-kill" | (in-package :cl-user)
(defpackage psychiq.launcher.heartbeat
(:use #:cl
#:psychiq.util)
(:import-from #:psychiq.connection
#:with-connection
#:connect
#:disconnect)
(:import-from #:psychiq.coder
#:encode-object)
(:import-from #:psychiq.laun... |
9e8d91345c2b8fdb7ca8156b297bb5a9c499cee88a80171227049f1f6f694bb2 | monadfix/ormolu-live | Internal.hs | {-# LANGUAGE Safe #-}
-- |
-- Language.Haskell.TH.Lib.Internal exposes some additional functionality that
is used internally in GHC 's integration with Template Haskell . This is not a
-- part of the public API, and as such, there are no API guarantees for this
-- module from version to version.
Why do we have bo... | null | https://raw.githubusercontent.com/monadfix/ormolu-live/d8ae72ef168b98a8d179d642f70352c88b3ac226/ghc-lib-parser-8.10.1.20200412/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs | haskell | # LANGUAGE Safe #
|
Language.Haskell.TH.Lib.Internal exposes some additional functionality that
part of the public API, and as such, there are no API guarantees for this
module from version to version.
Language.Haskell.TH.Lib? Ultimately, it's because the functions in the
involve a massive amount of breaking chan... |
is used internally in GHC 's integration with Template Haskell . This is not a
Why do we have both Language . Haskell . TH.Lib . Internal and
former ( which are tailored for GHC 's use ) need different type signatures
than the ones in the latter . Syncing up the Internal type signatures would
relegate as ma... |
6604484bb229315af073020b2402b2e10f525699d7a80054ecde7e171d75d7d9 | tisnik/clojure-examples | core_test.clj | ;
( C ) Copyright 2016 , 2020 , 2021
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(ns produce-messages-1.core-t... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/a5f9d6119b62520b05da64b7929d07b832b957ab/kafka-produce-messages-1/test/produce_messages_1/core_test.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2016 , 2020 , 2021
-v10.html
(ns produce-messages-1.core-test
(:require [clojure.test :refer :all]
[produce-messages-1.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
|
93d6c6623d4e11545e51e2d0e40a78396e1d4a4a2fbb0dd600fb30d820e2c4e3 | discoproject/disco | http_client.erl | -module(http_client).
-export([http_put_conn/3]).
-include_lib("kernel/include/file.hrl").
-include("common_types.hrl").
-define(CONNECT_TIMEOUT, 60000).
-define(BUFFER_SIZE, 8192).
-spec http_put_conn(path(), nonempty_string(), pid()) -> _.
http_put_conn(SrcPath, DstUrl, Parent) ->
{_, Addr, Path, Query, _} = ... | null | https://raw.githubusercontent.com/discoproject/disco/be65272d3eecca184a3c8f2fa911b86ac87a4e8a/master/src/http_client.erl | erlang | -module(http_client).
-export([http_put_conn/3]).
-include_lib("kernel/include/file.hrl").
-include("common_types.hrl").
-define(CONNECT_TIMEOUT, 60000).
-define(BUFFER_SIZE, 8192).
-spec http_put_conn(path(), nonempty_string(), pid()) -> _.
http_put_conn(SrcPath, DstUrl, Parent) ->
{_, Addr, Path, Query, _} = ... | |
a0b9e892c725e244a4fc96bcfb652415630ba2b06f4c7e082378a357f1252ebd | gafiatulin/codewars | Josephus.hs | -- Josephus Permutation
--
module Josephus where
import Data.List(unfoldr)
josephus :: [a] -> Int -> [a]
josephus xs k = unfoldr f (k - 1, xs)
where f (_, []) = Nothing
f (i, xs) = let p = i `mod` length xs in Just (xs !! p, (p + k - 1, take p xs ++ drop (p+1) xs))
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/5%20kyu/Josephus.hs | haskell | Josephus Permutation
|
module Josephus where
import Data.List(unfoldr)
josephus :: [a] -> Int -> [a]
josephus xs k = unfoldr f (k - 1, xs)
where f (_, []) = Nothing
f (i, xs) = let p = i `mod` length xs in Just (xs !! p, (p + k - 1, take p xs ++ drop (p+1) xs))
|
454167e4945ffbe955f104c6c3eae7c6f2f8b0814bf4b455689d2e7bf118cfa6 | mtgred/netrunner | winning.clj | (ns game.core.winning
(:require
[cljc.java-time.duration :as duration]
[cljc.java-time.instant :as inst]
[cond-plus.core :refer [cond+]]
[game.core.effects :refer [any-effects]]
[game.core.say :refer [play-sfx system-msg system-say]]
[game.utils :refer [dissoc-in]]
[jinteki.utils :refer [other-si... | null | https://raw.githubusercontent.com/mtgred/netrunner/8558b7718834f8c6b26c0db2b9ff9fb856f77240/src/clj/game/core/winning.clj | clojure | (ns game.core.winning
(:require
[cljc.java-time.duration :as duration]
[cljc.java-time.instant :as inst]
[cond-plus.core :refer [cond+]]
[game.core.effects :refer [any-effects]]
[game.core.say :refer [play-sfx system-msg system-say]]
[game.utils :refer [dissoc-in]]
[jinteki.utils :refer [other-si... | |
d6589d932b4e32ad6d3e90482bf9f5a422c3a2b2264e7d3661f3d6c3e59a1bb1 | bldl/magnolisp | test-let-expr-2.rkt | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (one)
(#:annos foreign (type (fn int)))
1)
(function (inc x)
(#:annos foreign (type (fn int int)))
(+ x 1))
(function (f x)
(#:annos export (type (fn int int)))
(var x #an(^int) (let-var y #an(^int) (one) (inc y)))
x)
(f 1)
| null | https://raw.githubusercontent.com/bldl/magnolisp/191d529486e688e5dda2be677ad8fe3b654e0d4f/tests/test-let-expr-2.rkt | racket | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (one)
(#:annos foreign (type (fn int)))
1)
(function (inc x)
(#:annos foreign (type (fn int int)))
(+ x 1))
(function (f x)
(#:annos export (type (fn int int)))
(var x #an(^int) (let-var y #an(^int) (one) (inc y)))
x)
(f 1)
| |
82b4b7fd09ac7eac337e8696107b15e0f6d0cadb1a219830c1dece4ec44facd2 | flavioc/cl-hurd | duplicate.lisp |
(in-package :hurd)
(defcfun ("io_duplicate" %io-duplicate)
err
(file port)
(newport port-pointer))
(defun io-duplicate (file)
"Duplicate the file port."
(declare (type fixnum file))
(with-foreign-pointer (newport (foreign-type-size 'port))
(select-error (%io-duplicate file newport)
... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/io/duplicate.lisp | lisp |
(in-package :hurd)
(defcfun ("io_duplicate" %io-duplicate)
err
(file port)
(newport port-pointer))
(defun io-duplicate (file)
"Duplicate the file port."
(declare (type fixnum file))
(with-foreign-pointer (newport (foreign-type-size 'port))
(select-error (%io-duplicate file newport)
... | |
6293de46602ed42830f4f7a407f9cabe9f9e6de0506062e669a5e5c0dc2e234f | KingMob/TrueGrit | circuit_breaker_test.clj | (ns net.modulolotus.truegrit.circuit-breaker-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[net.modulolotus.truegrit :refer [with-circuit-breaker]]
[net.modulolotus.truegrit.circuit-breaker :refer [call-allowed? circuit-breaker metrics retrieve wrap state-name]]
... | null | https://raw.githubusercontent.com/KingMob/TrueGrit/be63e14d1bccaa016fb4574f63bef961759c58f3/test/net/modulolotus/truegrit/circuit_breaker_test.clj | clojure | It's not feasible to test this realistically without introducing slowdown into the
Make exactly ring-buffer-size failing calls
CLOSED -> OPEN -> HALF-OPEN -> CLOSED | (ns net.modulolotus.truegrit.circuit-breaker-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[net.modulolotus.truegrit :refer [with-circuit-breaker]]
[net.modulolotus.truegrit.circuit-breaker :refer [call-allowed? circuit-breaker metrics retrieve wrap state-name]]
... |
5cfbc48bd1a8e98e893629d0a69d886ce6f116bf48e5b93d9f824494b301aafd | korya/efuns | wX_xterm.mli | (***********************************************************************)
(* *)
(* ____ *)
(* *)
Fabrice Le Fessa... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/toolkit/wX_xterm.mli | ocaml | *********************************************************************
____
... | Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
type char_drawing = Xtypes.setGCattributes list
and xterm_gc = int
and xterm_event =
| XTKeyPress ... |
ab08f7ccacda4d3e2a9bfe22bdc397a9af61b8e95e5c8f5cadf86b0ddf52b3a2 | ryanpbrewster/haskell | telephone_words.hs | -- telephone_words.hs
- Given a 7 digit telephone number , print out all the possible sequences of
- letters that can represent the given telephone number . Note that in
- a standard 12 key pad , 0 and 1 do not have any letters associated with them .
- They are to be treated as such , i.e. a 0/1 in the tele... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/CodeEval/telephone_words.hs | haskell | telephone_words.hs |
- Given a 7 digit telephone number , print out all the possible sequences of
- letters that can represent the given telephone number . Note that in
- a standard 12 key pad , 0 and 1 do not have any letters associated with them .
- They are to be treated as such , i.e. a 0/1 in the telephone number will be
... |
36ed59162bd47eb8026ffa2a06d960bf5ee2a6b6b11b8a070d81cba690c62e39 | voicerepublic/vr-logorrhoe | encoder.clj | (ns vr-logorrhoe.encoder
(:require
[vr-logorrhoe
[config :as config]
[utils :refer [log]]]
[clojure.java.shell2 :refer [sh]]))
(defn- lame-freq []
"Map between Hz and lame KHz notation"
(get {"44100" "44.1"
"22050" "22.05"
"48000" "48"}
(config/setting :sample-freq)))
(defn... | null | https://raw.githubusercontent.com/voicerepublic/vr-logorrhoe/e01c4a8599cdbbd25f982acece474669dd7fd6ef/src/vr_logorrhoe/encoder.clj | clojure | TODO: Needs a way to find the path to lame, even when bundled in resources/bin/
TODO: `print-input-stream` doesn't print anything | (ns vr-logorrhoe.encoder
(:require
[vr-logorrhoe
[config :as config]
[utils :refer [log]]]
[clojure.java.shell2 :refer [sh]]))
(defn- lame-freq []
"Map between Hz and lame KHz notation"
(get {"44100" "44.1"
"22050" "22.05"
"48000" "48"}
(config/setting :sample-freq)))
(defn... |
15260f54d806e7495a033c008e90d2fe1bba60397aedeefe86e02504ea6f7586 | bennguvaye/flu | rssd.ml | Simulate the single - strain ODE system using Dopri5
open Lacaml.D;;
let pi = 4. *. atan 1.;;
module type PARS =
sig
val size : float
val r0 : float
val e : float
val b : float
val etaN : float
val phi : float
val g : float
val nu : float
val nr : int
val init_perturb : flo... | null | https://raw.githubusercontent.com/bennguvaye/flu/5dbae212405b74917ee91392684fd2ee10ab1e58/src/rssd.ml | ocaml | to simplify computations
jacobian
the s, i, r values | Simulate the single - strain ODE system using Dopri5
open Lacaml.D;;
let pi = 4. *. atan 1.;;
module type PARS =
sig
val size : float
val r0 : float
val e : float
val b : float
val etaN : float
val phi : float
val g : float
val nu : float
val nr : int
val init_perturb : flo... |
8f684f5a317e1902adaefc71286c145fc9ed4ed59355e139f01099f38a735ad7 | D00mch/PWA-clojure | core.cljs | (ns pwa.core
(:require
[reagent.core :as r]
[goog.events :as events]
[goog.history.EventType :as HistoryEventType]
[markdown.core :refer [md->html]]
[pwa.ajax :as ajax]
[ajax.core :refer [GET POST]]
[reitit.core :as reitit]
[clojure.string :as string])
(:import goog.History))
(defon... | null | https://raw.githubusercontent.com/D00mch/PWA-clojure/39ab4d3690c7a8ddbdd8095d65a782961f92c183/src/cljs/pwa/core.cljs | clojure | -------------------------
Routes
-------------------------
History
must be called after routes have been defined
------------------------- | (ns pwa.core
(:require
[reagent.core :as r]
[goog.events :as events]
[goog.history.EventType :as HistoryEventType]
[markdown.core :refer [md->html]]
[pwa.ajax :as ajax]
[ajax.core :refer [GET POST]]
[reitit.core :as reitit]
[clojure.string :as string])
(:import goog.History))
(defon... |
41fa3bdb75ffd0db69dcf12352664d8485df94e49423e09f54ef823228540a17 | ndmitchell/supero | Digits_of_e1_part1.hs |
module Test.Other.Digits_of_e1_part1(test) where
#include "Include.hs"
type ContFrac = [Integer]
ratTrans ( a , b , c , d ) x : compute ( a + bx)/(c+dx ) as a continued fraction
ratTrans :: (Integer,Integer,Integer,Integer) -> ContFrac -> ContFrac
-- Output a digit if we can
ratTrans abcd xs = case abcd of
(... | null | https://raw.githubusercontent.com/ndmitchell/supero/a8b16ea90862e2c021bb139d7a7e9a83700b43b2/supero4/Test/Other/Digits_of_e1_part1.hs | haskell | Output a digit if we can
No pole in range |
module Test.Other.Digits_of_e1_part1(test) where
#include "Include.hs"
type ContFrac = [Integer]
ratTrans ( a , b , c , d ) x : compute ( a + bx)/(c+dx ) as a continued fraction
ratTrans :: (Integer,Integer,Integer,Integer) -> ContFrac -> ContFrac
ratTrans abcd xs = case abcd of
(aa,bb,cc,dd) ->
let a =... |
03762113f89e3a023751d4d46310efdc8718400dc03794db6fb715336483ca73 | ninjudd/cake | classloader.clj | (ns cake.classloader
(:use cake
[cake.deps :only [deps]]
[cake.file :only [file global-file path-string]]
[bake.core :only [debug?]]
[classlojure.core :exclude [with-classloader]]
[classlojure.io :only [resource-forms]]
[uncle.core :only [fileset-seq]]
[useful.f... | null | https://raw.githubusercontent.com/ninjudd/cake/3a1627120b74e425ab21aa4d1b263be09e945cfd/src/cake/classloader.clj | clojure | (ns cake.classloader
(:use cake
[cake.deps :only [deps]]
[cake.file :only [file global-file path-string]]
[bake.core :only [debug?]]
[classlojure.core :exclude [with-classloader]]
[classlojure.io :only [resource-forms]]
[uncle.core :only [fileset-seq]]
[useful.f... | |
20ef457600519b514d8cd7e76c4e7c54d6a696ec767b3d1c65617835436c9c01 | juxt/fuzz | om_slacky.cljs | (ns fuzz.om-slacky
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [sablono.core :as html :refer-macros [html]]
[om-tools.core :refer-macros [defcomponent]]
[fuzz.slacky :as slacky]
[om.core :as om :include-macros true]))
(def app-state (atom {:messages ... | null | https://raw.githubusercontent.com/juxt/fuzz/688b64b8750137402857e01e89c0c0307ea87425/src/cljs/fuzz/om_slacky.cljs | clojure | Rendering ---------
Application -------
See notes (atom in fig) | (ns fuzz.om-slacky
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [sablono.core :as html :refer-macros [html]]
[om-tools.core :refer-macros [defcomponent]]
[fuzz.slacky :as slacky]
[om.core :as om :include-macros true]))
(def app-state (atom {:messages ... |
8a81d7f9d1ac9ebcdd5bb5407e91136514a1edc3c5f09634b3cf60eb09ed78a0 | oakes/Nightcode | editors.clj | (ns nightcode.editors
(:require [clojure.java.io :as io]
[clojure.edn :as edn]
[ring.adapter.jetty :refer [run-jetty]]
[ring.middleware.resource :refer [wrap-resource]]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.util.response :refer [red... | null | https://raw.githubusercontent.com/oakes/Nightcode/2e112c59cddc5fdec96059a08912c73b880f9ae8/src/clj/nightcode/editors.clj | clojure | prevent bridge from being GC'ed | (ns nightcode.editors
(:require [clojure.java.io :as io]
[clojure.edn :as edn]
[ring.adapter.jetty :refer [run-jetty]]
[ring.middleware.resource :refer [wrap-resource]]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.util.response :refer [red... |
78a76a1e215d1169e1b02338314e571deeb65d6508a525743e5ec3680074d023 | BranchTaken/Hemlock | test_bit_and_bit_or_bit_xor.ml | open! Basis.Rudiments
open! Basis
open U32
let test () =
let rec test_pairs = function
| [] -> ()
| (x, y) :: pairs' -> begin
File.Fmt.stdout
|> Fmt.fmt "bit_{and,or,xor} "
|> fmt ~alt:true ~zpad:true ~width:8L ~radix:Radix.Hex ~pretty:true x
|> Fmt.fmt " "
|> fmt ~alt... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/u32/test_bit_and_bit_or_bit_xor.ml | ocaml | open! Basis.Rudiments
open! Basis
open U32
let test () =
let rec test_pairs = function
| [] -> ()
| (x, y) :: pairs' -> begin
File.Fmt.stdout
|> Fmt.fmt "bit_{and,or,xor} "
|> fmt ~alt:true ~zpad:true ~width:8L ~radix:Radix.Hex ~pretty:true x
|> Fmt.fmt " "
|> fmt ~alt... | |
7f6e591ccdd8d57902a3c7d682c12d5071ac7bd31dacb74e49dea82c95b3157c | hopbit/sonic-pi-snippets | ll_dnb_brk.sps | # key: ll dnb brk
# point_line: 3
# point_index: 0
# --
live_loop :beats do
# use_bpm 170
sample :loop_breakbeat, beat_stretch: 4, amp: 0.25
sleep 4
end
| null | https://raw.githubusercontent.com/hopbit/sonic-pi-snippets/2232854ac9587fc2f9f684ba04d7476e2dbaa288/live_loop/ll_dnb_brk.sps | scheme | # key: ll dnb brk
# point_line: 3
# point_index: 0
# --
live_loop :beats do
# use_bpm 170
sample :loop_breakbeat, beat_stretch: 4, amp: 0.25
sleep 4
end
| |
648db26e3d7a1a20d772ac2d2ba8a4bb4a9f8269f8c58dfd4099c822400273ca | chaoxu/mgccl-haskell | UnfriendlyNumbers.hs | import Data.List
import qualified Data.Set as Set
main = do
line <- getIntegerList
line2 <- getIntegerList
putStrLn (show $ test line2 (last line))
getIntegerList = do
line <- getLine
let tmp = words line
return (map read tmp :: [Integer])
--test u k = length $ filter (not) $ map try divisors
test ... | null | https://raw.githubusercontent.com/chaoxu/mgccl-haskell/bb03e39ae43f410bd2a673ac2b438929ab8ef7a1/interviewstreet/UnfriendlyNumbers.hs | haskell | test u k = length $ filter (not) $ map try divisors
list = (nubOrd $ map (gcd k) u)
snub = map head . group . sort
or: primes | import Data.List
import qualified Data.Set as Set
main = do
line <- getIntegerList
line2 <- getIntegerList
putStrLn (show $ test line2 (last line))
getIntegerList = do
line <- getLine
let tmp = words line
return (map read tmp :: [Integer])
test :: [Integer] -> Integer -> Int
test u k = length list
... |
1e59660c231fb32b6e55060853d089960eb6529a442e77a0e0e5987064daaaef | binaryage/chromex | sync_file_system.cljs | (ns chromex.app.sync-file-system (:require-macros [chromex.app.sync-file-system :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn request-file-system* [config]
(gen-wrap :function ::r... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps/chromex/app/sync_file_system.cljs | clojure | -- events ----------------------------------------------------------------------------------------------------------------- | (ns chromex.app.sync-file-system (:require-macros [chromex.app.sync-file-system :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn request-file-system* [config]
(gen-wrap :function ::r... |
bf99f2bf2ae3715517d4a9e5c760332ebee0512709be56d44052134108ca1a2b | soulomoon/SICP | Exercise3.52.scm | Exercise 3.52 : Consider the sequence of expressions
; (define sum 0)
( define ( )
; (set! sum (+ x sum))
; sum)
; (define seq
; (stream-map
( stream - enumerate - interval 1 20 ) ) )
; (define y (stream-filter even? seq))
; (define z
; (stream-filter
; (lambda (x)
(= ( rema... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter3/Exercise3.52.scm | scheme | (define sum 0)
(set! sum (+ x sum))
sum)
(define seq
(stream-map
(define y (stream-filter even? seq))
(define z
(stream-filter
(lambda (x)
(stream-ref y 7)
(display-stream z)
What is the value of sum after each of the above expressions is evaluated? What is the printed response to evaluating... | Exercise 3.52 : Consider the sequence of expressions
( define ( )
( stream - enumerate - interval 1 20 ) ) )
(= ( remainder x 5 ) 0 ) ) seq ) )
(load "/home/soulomoon/git/SICP/Chapter3/stream.scm")
(define sum 0)
(define (accum x)
(set! sum (+ x sum))
sum)
0
(define seq
(stream-... |
ed36b881dba132ea0be648449b911c41f0c2ed4657354a4fd679da122f46fd70 | grin-compiler/grin | DeadDataEliminationSpec.hs | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Transformations.Optimising.DeadDataEliminationSpec where
import Test.Hspec
import qualified Data.Map as Map
import qualified Data.Set as Set
import Grin.Grin
import Grin.TH
import Grin.TypeCheck (typeEnvFromHPTResult)
import Test.Hspec.PipelineExample
import Pipeli... | null | https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/test/Transformations/Optimising/DeadDataEliminationSpec.hs | haskell | consumers
consumers
consumers
consumers
consumers
consumers
consumers
functions cannot return pointers | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Transformations.Optimising.DeadDataEliminationSpec where
import Test.Hspec
import qualified Data.Map as Map
import qualified Data.Set as Set
import Grin.Grin
import Grin.TH
import Grin.TypeCheck (typeEnvFromHPTResult)
import Test.Hspec.PipelineExample
import Pipeli... |
474a3ffd8317ce3afb201a038b7add92e6d524fabbde86a9a6e8ea8f44eb0690 | avsm/mirage-ci | term_utils.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... | null | https://raw.githubusercontent.com/avsm/mirage-ci/a11ecf203976299fa19337fd9e1794d6ca3fa436/src/term_utils.mli | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... | |
1ba7018bd16d8b297f54a7303b84c85a04eca24737cc912208bbaec28596aecd | futurice/clojure-workshop | 14_recursion.clj | (ns koans.14-recursion
(:require [koan-engine.core :refer :all]))
(defn is-even? [n]
(if (= n 0)
__
(___ (is-even? (dec n)))))
(defn is-even-bigint? [n]
(loop [n n
acc true]
(if (= n 0)
__
(recur (dec n) (not acc)))))
(defn recursive-reverse [coll]
__)
(defn factorial [n]
... | null | https://raw.githubusercontent.com/futurice/clojure-workshop/c1e64a03e1115289898838d4f19f727bc51e2b34/materials/section-1/src/koans/14_recursion.clj | clojure | (ns koans.14-recursion
(:require [koan-engine.core :refer :all]))
(defn is-even? [n]
(if (= n 0)
__
(___ (is-even? (dec n)))))
(defn is-even-bigint? [n]
(loop [n n
acc true]
(if (= n 0)
__
(recur (dec n) (not acc)))))
(defn recursive-reverse [coll]
__)
(defn factorial [n]
... | |
5be355f0d891cc4c6df66941ed24527d36b27961dfc316af1faf60be2ec7ba45 | tomhanika/conexp-clj | contexts.clj | (ns conexp.gui.editors.contexts
"Provides context-editor, a plugin for contexts for the standard GUI of conexp-clj."
(:require [conexp.base :refer :all]
[conexp.fca.contexts :refer :all]
[conexp.fca.lattices :refer :all]
[conexp.fca.protoconcepts :refer :all]
[conexp.... | null | https://raw.githubusercontent.com/tomhanika/conexp-clj/1388ff3e47d76af591b24b3c647b1524deb7a4c5/src/main/clojure/conexp/gui/editors/contexts.clj | clojure | The Actions
The Hooks
The End | (ns conexp.gui.editors.contexts
"Provides context-editor, a plugin for contexts for the standard GUI of conexp-clj."
(:require [conexp.base :refer :all]
[conexp.fca.contexts :refer :all]
[conexp.fca.lattices :refer :all]
[conexp.fca.protoconcepts :refer :all]
[conexp.... |
4f2f065dd5ef7b51d79e8ddfdcf0e89edf78bf8e907f0398b83b3f9ad6ee7e8a | haskell/ThreadScope | Ticks.hs | # LANGUAGE CPP #
module GUI.Timeline.Ticks (
renderVRulers,
XScaleMode(..),
renderXScaleArea,
renderXScale,
renderHRulers,
renderYScale,
mu,
deZero,
) where
import Events.HECs
import GUI.Types
import GUI.Timeline.CairoDrawing
import GUI.ViewerColours
import Graphics.Rendering.Cairo
i... | null | https://raw.githubusercontent.com/haskell/ThreadScope/d70f45eb1d6a5dab13d4ea338d58d91389b77bd4/GUI/Timeline/Ticks.hs | haskell | the ticks is determined by the zoom level.
minor tick).
canvas is in milliseconds (ms) (1e-3).
scaleValue is used to divide a timestamp value to yield a pixel value.
NOTE: the code below will crash if the timestampFor100Pixels is 0.
The zoom factor should be controlled to ensure that this never happens.
| Render... | # LANGUAGE CPP #
module GUI.Timeline.Ticks (
renderVRulers,
XScaleMode(..),
renderXScaleArea,
renderXScale,
renderHRulers,
renderYScale,
mu,
deZero,
) where
import Events.HECs
import GUI.Types
import GUI.Timeline.CairoDrawing
import GUI.ViewerColours
import Graphics.Rendering.Cairo
i... |
fdb9e22da95400a88b39854311fd35d671bbd304251b03726f0be9ba78022ed6 | Liqwid-Labs/liqwid-libs | API.hs | | Module : ScriptExport . API
Maintainer :
Description : API for script exporter .
API for script exporter .
Maintainer :
Description: API for script exporter.
API for script exporter.
-}
module ScriptExport.API (
API,
runServer,
) where
import Codec.Serialise.Orpha... | null | https://raw.githubusercontent.com/Liqwid-Labs/liqwid-libs/ea3553eeeb8493f7430204ca730f468827bd464c/liqwid-script-export/src/ScriptExport/API.hs | haskell | | Servant API type for script generation.
@since 2.0.0
POST /query-script/:name
GET /query-script/:name
GET /info
NOTE: Webpack dev server requires this for CORS workaround. | | Module : ScriptExport . API
Maintainer :
Description : API for script exporter .
API for script exporter .
Maintainer :
Description: API for script exporter.
API for script exporter.
-}
module ScriptExport.API (
API,
runServer,
) where
import Codec.Serialise.Orpha... |
da4ee294780c2e0ed812988093fe60925a213b02681b23bd503798a10d97418d | discoproject/disco | ddfs_tag_test.erl | -module(ddfs_tag_test).
-export([check_token_test/0]).
-include_lib("triq/include/triq.hrl").
Workaround for Issue 161 .
safe_binary() ->
?LET(X, list(char()), list_to_binary(X)).
token() ->
oneof([null, safe_binary()]).
tokentype() ->
oneof([read, write]).
user_attr() ->
list({safe_binary(), saf... | null | https://raw.githubusercontent.com/discoproject/disco/be65272d3eecca184a3c8f2fa911b86ac87a4e8a/master/test/ddfs_tag_test.erl | erlang | id
last_modified
read_token
urls
user
Sanity check the tag encoding and decoding.
Ensure that tag date returned as a result of API calls contain the
appropriate tokens.
This does not really need to be a FORALL, just a single instance
would do. It would be nice for triq to support this. Using
(i) eunit and ... | -module(ddfs_tag_test).
-export([check_token_test/0]).
-include_lib("triq/include/triq.hrl").
Workaround for Issue 161 .
safe_binary() ->
?LET(X, list(char()), list_to_binary(X)).
token() ->
oneof([null, safe_binary()]).
tokentype() ->
oneof([read, write]).
user_attr() ->
list({safe_binary(), saf... |
5b4bad881654c1444cd8f3a0f08aba9081c14851bc2a50865b2b1c2487da5379 | aniketpant/fraskell | files.hs |
Write a program that first asks whether the user wants to read from a file ,
write to a file or quit . If the user responds quit , the program should exit .
If he responds read , the program should ask him for a file name and print
that file to the screen ( if the file does n't exist , the program may crash ) .... | null | https://raw.githubusercontent.com/aniketpant/fraskell/e1c0f9a11bada28907980f08eff86106d67bf4f5/interaction/files.hs | haskell |
Write a program that first asks whether the user wants to read from a file ,
write to a file or quit . If the user responds quit , the program should exit .
If he responds read , the program should ask him for a file name and print
that file to the screen ( if the file does n't exist , the program may crash ) .... | |
b5973189c5f32b956d395944f3689bd608136b60558148692bfff12115314351 | ocsigen/ocsimore | wiki_syntax.ml | Ocsimore
* Copyright ( C ) 2008
* Laboratoire PPS - Université Paris Diderot - CNRS
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
... | null | https://raw.githubusercontent.com/ocsigen/ocsimore/8eeaf043ed6f1f167a96cbdc5f72a5225d9516d5/src/wiki/server/wiki_syntax.ml | ocaml | *
/!\ NOT TAIL REC /!\
at1; at2; at3;
and at1 =
try Some (Html5.F.a_char (List.assoc "char" attribs).[0])
with Not_found | Invalid_argument _ -> None
at1; at2; at3; at4;
opening types
opening types
* If [list] starts with [prefix] and ends with [res] (i.e. [list = prefix @ res]
[list_suffix ~pref... | Ocsimore
* Copyright ( C ) 2008
* Laboratoire PPS - Université Paris Diderot - CNRS
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
... |
d3cbcffa882067bd85fba11b5176c2519cc42486ddff0db6ab7d045761087971 | dimitri/pgloader | parse-ini.lisp | ;;;
;;; Compatibility package to read old configuration file format.
;;;
(in-package :pgloader.ini)
(defparameter *global-section* "pgsql")
(defstruct params
filename table format is-template use-template
fields columns
truncate encoding logs rejects gucs
separator null-as empty-string skip-lines)
(defun pr... | null | https://raw.githubusercontent.com/dimitri/pgloader/3047c9afe141763e9e7ec05b7f2a6aa97cf06801/src/parsers/parse-ini.lisp | lisp |
Compatibility package to read old configuration file format.
don't inherit the is-template property from the template
that's again something kind of special
that's the format used when user-defined columns are in play
now parse gucs
now parse fields and columns
fetch table name from current section or its temp... |
(in-package :pgloader.ini)
(defparameter *global-section* "pgsql")
(defstruct params
filename table format is-template use-template
fields columns
truncate encoding logs rejects gucs
separator null-as empty-string skip-lines)
(defun process-true-false (value)
"parse python boolean values"
(cond ((string... |
4ac9d8482c571ed2316c53033c9973e1f5c9ecbfb961e7db91ff2ff810a05809 | fiatjaf/hledger-web | Main.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE DeriveGeneric #
module Main where
import Prelude hiding (unlines, replicate)
import Control.Concurrent
import Data.Text hiding (pack, map)
import Data.Function
import Data.JSString.Text (textFromJSVal)
import JavaScript.Array.Internal
import Hl... | null | https://raw.githubusercontent.com/fiatjaf/hledger-web/ff1e31a679507b4d407ef89b18a8707bf7a558b4/app/Main.hs | haskell | # LANGUAGE OverloadedStrings #
0.8s | # LANGUAGE RecordWildCards #
# LANGUAGE DeriveGeneric #
module Main where
import Prelude hiding (unlines, replicate)
import Control.Concurrent
import Data.Text hiding (pack, map)
import Data.Function
import Data.JSString.Text (textFromJSVal)
import JavaScript.Array.Internal
import Hledger.Read (readJournal)
import Hle... |
eb58472422eaa1ecfb76365901218090b0d4dd39ce96b68f84c7f5cddb6b3060 | lspitzner/butcher | TestMain.hs | module Main where
#include "prelude.inc"
import Test.Hspec
import NeatInterpolation
import UI.Butcher.Monadic
import UI.Butcher.Monadic.Types
import UI.Butcher.Monadic.Interactive
main :: IO ()
main = hspec $ tests
tests :: Spec
tests = do
describe "checkTests" checkTests
describe "simpleParseTest" simp... | null | https://raw.githubusercontent.com/lspitzner/butcher/ad17fe776359a25e4d1bebc7890d1bf3da0880f0/src-tests/TestMain.hs | haskell | no reordering
no reordering | module Main where
#include "prelude.inc"
import Test.Hspec
import NeatInterpolation
import UI.Butcher.Monadic
import UI.Butcher.Monadic.Types
import UI.Butcher.Monadic.Interactive
main :: IO ()
main = hspec $ tests
tests :: Spec
tests = do
describe "checkTests" checkTests
describe "simpleParseTest" simp... |
4430e0f8b1d6557723ee0d3e42b52f454fa998d7d0c301b1d2d1a08c493d712a | vehicle-lang/vehicle | Monad.hs | module Vehicle.Compile.Type.Monad
( TCM,
MonadTypeChecker (..),
TypeCheckerState,
TypableBuiltin (..),
-- Top-level interface
runTypeChecker,
runTypeCheckerHypothetically,
adoptHypotheticalState,
Meta variables
freshMetaExpr,
freshMetaIdAndExpr,
getMetaType,
getMetaCtx,
... | null | https://raw.githubusercontent.com/vehicle-lang/vehicle/3a3548f9b48c3969212ccb51e954d4d4556ea815/vehicle/src/Vehicle/Compile/Type/Monad.hs | haskell | Top-level interface
Constraints
Other
| The type-checking monad.
| Runs a hypothetical computation in the type-checker,
returning the resulting state of the type-checker.
If we errored then reset the call depth so logging is not disrupted.
| Accepts the hypothetical outcome of the type-checker.
derived from an... | module Vehicle.Compile.Type.Monad
( TCM,
MonadTypeChecker (..),
TypeCheckerState,
TypableBuiltin (..),
runTypeChecker,
runTypeCheckerHypothetically,
adoptHypotheticalState,
Meta variables
freshMetaExpr,
freshMetaIdAndExpr,
getMetaType,
getMetaCtx,
getMetaProvenance,
g... |
47e10033ae77a0232cae4d698af31c4c8b7d74677d591113763f967eb8b5a484 | andrewvc/engulf | http_benchmark_aggregations.clj | (defn empty-edge-aggregation
[params]
{"type" "aggregate-edge"
"runtime" 0
"runs-total" 0
"runs-succeeded" 0
"runs-failed" 0
"status-codes" {}
"time-slices" {}
"all-runtimes" []})
(defn empty-relay-aggregation
[params]
{"type" "aggregate-relay"
"runtime" 0
"runs-total" 0
"runs-suc... | null | https://raw.githubusercontent.com/andrewvc/engulf/31c71c1e0b304a6c99189d0448105299ef05619c/src/engulf/formulas/http_benchmark_aggregations.clj | clojure | (defn empty-edge-aggregation
[params]
{"type" "aggregate-edge"
"runtime" 0
"runs-total" 0
"runs-succeeded" 0
"runs-failed" 0
"status-codes" {}
"time-slices" {}
"all-runtimes" []})
(defn empty-relay-aggregation
[params]
{"type" "aggregate-relay"
"runtime" 0
"runs-total" 0
"runs-suc... | |
aadef25d9958474fc6fe136398c078efb030aa893204830824b391fca6e3ac75 | thi-ng/crypto | core.clj | (ns thi.ng.crypto.core
(:require
[clojure.java.io :as io])
(:import
[org.bouncycastle.jce.provider
BouncyCastleProvider]
[org.bouncycastle.bcpg
ArmoredOutputStream
HashAlgorithmTags]
[org.bouncycastle.openpgp
PGPObjectFactory
PGPPublicKeyRingCollection
PGPSecretKeyRingCollection
... | null | https://raw.githubusercontent.com/thi-ng/crypto/663a83148cc49cf5793eb7352dcd754b4dd174ab/src/thi/ng/crypto/core.clj | clojure | (ns thi.ng.crypto.core
(:require
[clojure.java.io :as io])
(:import
[org.bouncycastle.jce.provider
BouncyCastleProvider]
[org.bouncycastle.bcpg
ArmoredOutputStream
HashAlgorithmTags]
[org.bouncycastle.openpgp
PGPObjectFactory
PGPPublicKeyRingCollection
PGPSecretKeyRingCollection
... | |
09b9bbc5bcdc1e69743f92536228b547efb2a2d29176124f38574d05498c6832 | byorgey/diagrams-play | RenderTree.hs | # LANGUAGE NoMonomorphismRestriction #
module RenderTree where
import Data.Maybe (fromMaybe)
import System.Environment (withArgs)
import Data.Tree (Tree(Node))
import Diagrams.Prelude
import Diagrams.Backend.Cairo.Text (textLineBoundedIO)
import Diagrams.TwoD.Layout.Tree (renderTree, symmLayout', slHSep, slVSep, slWi... | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/RenderTree.hs | haskell | , | # LANGUAGE NoMonomorphismRestriction #
module RenderTree where
import Data.Maybe (fromMaybe)
import System.Environment (withArgs)
import Data.Tree (Tree(Node))
import Diagrams.Prelude
import Diagrams.Backend.Cairo.Text (textLineBoundedIO)
import Diagrams.TwoD.Layout.Tree (renderTree, symmLayout', slHSep, slVSep, slWi... |
9c25eeed9b4f2c1a72257e99626a51c424708bf496fcc0baa15f96b945ba2f9f | AmpersandTarski/Ampersand | PredLogic.hs | module Ampersand.Output.PredLogic
( showPredLogic,
)
where
import Ampersand.ADL1
import Ampersand.Basics hiding (toList)
import Ampersand.Classes
import qualified RIO.List as L
TODO Use NonEmpty
-- import qualified RIO.Map as M
import qualified RIO.NonEmpty as NE
import qualified RIO.Set as Set
import qualified ... | null | https://raw.githubusercontent.com/AmpersandTarski/Ampersand/8a1c00e3b0aeccd7ea6283b20097a8b73310b138/src/Ampersand/Output/PredLogic.hs | haskell | import qualified RIO.Map as M
| R _ a r b is represented as a r b
but if isIdent r then it is represented as a = b
| A variable. e.g.: x
| Function a f is represented in text as f(a)
| Dom expr (a,_) is represented as a ∈ dom(expr)
predLshow exists for the purpose of translating a predicate logic term to natura... | module Ampersand.Output.PredLogic
( showPredLogic,
)
where
import Ampersand.ADL1
import Ampersand.Basics hiding (toList)
import Ampersand.Classes
import qualified RIO.List as L
TODO Use NonEmpty
import qualified RIO.NonEmpty as NE
import qualified RIO.Set as Set
import qualified RIO.Text as T
import Text.Pandoc.... |
c16061edc6fd3598a92ed46f22fd9f7fd2ae6b6d1d4f58226f5d48f9e99f0b0d | lehins/primal | Base16.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
{-# LANGUAGE ExplicitForAll #-}
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE MagicHash #
# LANGUAGE TypeFamilies #
{-# LANGUAGE UnliftedFFITypes #-}
-- |
Module : Primal . Memory . Encoding .
Copyright : ( c ) 2021
-- License : BSD3
Maintai... | null | https://raw.githubusercontent.com/lehins/primal/c752d8788cb9597224d6f7e6a5163473a74b7b5a/primal-memory/src/Primal/Memory/Encoding/Base16.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ExplicitForAll #
# LANGUAGE UnliftedFFITypes #
|
License : BSD3
Stability : experimental
Portability : non-portable
* Encode
* Decode
| Error produced when decoding fails.
@since 1.0.0
^ Error produced when length of the input is unepxected
^ Error produced when une... | # LANGUAGE DataKinds #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE MagicHash #
# LANGUAGE TypeFamilies #
Module : Primal . Memory . Encoding .
Copyright : ( c ) 2021
Maintainer : < >
module Primal.Memory.Encoding.Base16
(
encodeBase16
, encodeBase16Mem
, encodeBase16MutMem
, Dec... |
bc1fd3fa13ed7fdc834218c0dfcbb3c5f9066f4ba064131e6cdfe688dcc1188a | ocharles/blog | 2014-01-20-tasty-rerun.hs | import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Test.Tasty.Runners
import Test.Tasty.Ingredients.Rerun
main :: IO ()
main = defaultMainWithIngredients [ rerunningTests [ consoleTestReporter ] ] tests
tests :: TestTree
tests = testGroup "Sums"
[ testCase "Addition" $ 1 + 1 @?= 3
, tes... | null | https://raw.githubusercontent.com/ocharles/blog/fa8e911d3c03b134eee891d187a1bb574f23a530/code/2014-01-20-tasty-rerun.hs | haskell | import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Test.Tasty.Runners
import Test.Tasty.Ingredients.Rerun
main :: IO ()
main = defaultMainWithIngredients [ rerunningTests [ consoleTestReporter ] ] tests
tests :: TestTree
tests = testGroup "Sums"
[ testCase "Addition" $ 1 + 1 @?= 3
, tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.