_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 |
|---|---|---|---|---|---|---|---|---|
27afbbd3546dfb6ca1d00ce763ea7934e9a416766dcd77f08eed0fb2b0b7be98 | kiranlak/austin-sbst | branchtrace.ml | Copyright : , University College London , 2011
open Cil
open Printf
open Cfginfo
open Utils
open TraceManager
module Log = LogManager
let prototypeFundecs = ref []
let branchInfos : (int,exp) Hashtbl.t = Hashtbl.create Options.hashtblInitSize
let reset () =
prototypeFundecs := [];
Hashtbl.clear branchInfos
... | null | https://raw.githubusercontent.com/kiranlak/austin-sbst/9c8aac72692dca952302e0e4fdb9ff381bba58ae/AustinOcaml/instrumentation/branchtrace.ml | ocaml | typeToString pt
number of values
invert expression, because we want to know how far away execution was from avoiding this branch
*TODO: default distance should be negation for each case, and then minimum of all the other cases vs default case
iter through hashtable and find minimum
add it
insert send distance c... | Copyright : , University College London , 2011
open Cil
open Printf
open Cfginfo
open Utils
open TraceManager
module Log = LogManager
let prototypeFundecs = ref []
let branchInfos : (int,exp) Hashtbl.t = Hashtbl.create Options.hashtblInitSize
let reset () =
prototypeFundecs := [];
Hashtbl.clear branchInfos
... |
3fe4e02129596c8a916b75dc21d003633cb8cd427dbb3426f5148f4b7d76216e | s-expressionists/Cleavir | defaults.lisp | (in-package #:cleavir-graph)
(defun depth-first-preorder-thunk (start-node map-successors-fun)
(declare (type node-mapper map-successors-fun))
(lambda (function)
(declare (type (function (t)) function))
(let ((table (make-hash-table :test #'eq)))
(labels ((traverse (node)
(unless (ge... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/e0293780d356a9d563af9abf9317019f608b4e1d/Graph/defaults.lisp | lisp | by exhaustively iterating through with the successor function, filling a
table of predecessor relationships, to use for future reference. | (in-package #:cleavir-graph)
(defun depth-first-preorder-thunk (start-node map-successors-fun)
(declare (type node-mapper map-successors-fun))
(lambda (function)
(declare (type (function (t)) function))
(let ((table (make-hash-table :test #'eq)))
(labels ((traverse (node)
(unless (ge... |
7e30425a09e1f4e35182537b117aca9b82237ece4389320bcfb8a18a764422c8 | lspitzner/brittany | Test88.hs | func x | x = simple expression
| otherwise = 0
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test88.hs | haskell | func x | x = simple expression
| otherwise = 0
| |
dc2ebd3d3fe9e392e989c75037e6f739c3f7f7511111b6ada3ddf423cdc08ec3 | mejgun/haskell-tdlib | StickerSetInfo.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.StickerSetInfo where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ClosedVectorPath as ClosedVectorPath
import qualified TD.Data.Sticker as Sticker
import qualified TD.Data.StickerFormat as StickerFormat
import q... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Data/StickerSetInfo.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
| Represents short information about a sticker set
| Total number of stickers in the set
| True for already viewed trending sticker sets
| Type of the stickers in the set
| Format of the stickers in the set
| True, if the sticker set is official
| True, if the sticker set has... |
module TD.Data.StickerSetInfo where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ClosedVectorPath as ClosedVectorPath
import qualified TD.Data.Sticker as Sticker
import qualified TD.Data.StickerFormat as StickerFormat
import qualified TD.Data.StickerType as StickerT... |
39d34064132b452021692f695201ec5e8ccd7f75687998c8aa994d0f91860a20 | bmeurer/ocaml-experimental | odoc_comments.ml | (***********************************************************************)
(* OCamldoc *)
(* *)
, projet Cristal , INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/ocamldoc/odoc_comments.ml | ocaml | *********************************************************************
OCamldoc
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 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 Odoc_types
let print_DEBUG... |
e7ff05a6679216c3d2523c9d2da90c17a88fffcaaf3acfb0e08cd22dfa9d8088 | GaloisInc/ivory | Overflow.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module Overflow where
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
ovf1 :: Def ('[Sint8] ':-> Sint8)
ovf1 = proc "ovf1" $ \ n -> body $
ifte_ (n <? maxBound - 20)
(ret (n + 15))
(ret (n .% 2))
ovf2 :: Def ('[Sint8] ':-> Sint8)
ovf2 ... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory-examples/examples/Overflow.hs | haskell | x <- assign (n / m / o)
incl ovf1 >> incl ovf2 >> | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module Overflow where
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
ovf1 :: Def ('[Sint8] ':-> Sint8)
ovf1 = proc "ovf1" $ \ n -> body $
ifte_ (n <? maxBound - 20)
(ret (n + 15))
(ret (n .% 2))
ovf2 :: Def ('[Sint8] ':-> Sint8)
ovf2 ... |
2b291600e0e94131841af0a9c6b3c46aacdb46b305dfbcfd5fe2ed10349b9f2a | den1k/vimsical | style.clj | (ns vimsical.frontend.vcr.style
(:require [vimsical.frontend.timeline.style :refer [timeline]]
[vimsical.frontend.code-editor.style :refer [code-editor]]
[vimsical.frontend.vcr.libs.style :refer [libs]]
[vimsical.frontend.styles.color :as color :refer [colors]]
[vimsica... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/vcr/style.clj | clojure | height set on component due requirement of precise height by
split component
width set on component due requirement of precise height by
split component
Styles to prevent code-editor from overflowing beyond VCR's boundaries
Set here instead of on code-editor to allow widget overflow | (ns vimsical.frontend.vcr.style
(:require [vimsical.frontend.timeline.style :refer [timeline]]
[vimsical.frontend.code-editor.style :refer [code-editor]]
[vimsical.frontend.vcr.libs.style :refer [libs]]
[vimsical.frontend.styles.color :as color :refer [colors]]
[vimsica... |
650422dd01ba24148468f01bac6f587d92670fca3efdc86b805fb7658157f5e0 | rd--/hsc3 | Types.hs | | Composite module of all Ugen related types .
module Sound.Sc3.Ugen.Types (module M) where
import Sound.Sc3.Ugen.Brackets as M
import Sound.Sc3.Ugen.Control as M
import Sound.Sc3.Ugen.Constant as M
import Sound.Sc3.Ugen.Label as M
import Sound.Sc3.Ugen.Mrg as M
import Sound.Sc3.Ugen.Primitive as M
import Sound.Sc3.... | null | https://raw.githubusercontent.com/rd--/hsc3/65b0ae5422dfd9c6458c5a97dfb416ab80bd7a72/Sound/Sc3/Ugen/Types.hs | haskell | | Composite module of all Ugen related types .
module Sound.Sc3.Ugen.Types (module M) where
import Sound.Sc3.Ugen.Brackets as M
import Sound.Sc3.Ugen.Control as M
import Sound.Sc3.Ugen.Constant as M
import Sound.Sc3.Ugen.Label as M
import Sound.Sc3.Ugen.Mrg as M
import Sound.Sc3.Ugen.Primitive as M
import Sound.Sc3.... | |
046b73069113914c3a6a16518949dba8c752b53f6919a809b509cccf2da77035 | ocamllabs/ocaml-modular-implicits | t250-closurerec-1.ml | open Lib;;
let rec f _ = 0;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 14
11 CONST0
12 RETURN 1
14 CLOSUREREC 0 , 11
18 ACC0
19 MAKEBLOCK1 0
21 POP 1
23 SETGLOBAL T250 - closurerec-1
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t250-closurerec-1.ml | ocaml | open Lib;;
let rec f _ = 0;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 14
11 CONST0
12 RETURN 1
14 CLOSUREREC 0 , 11
18 ACC0
19 MAKEBLOCK1 0
21 POP 1
23 SETGLOBAL T250 - closurerec-1
... | |
2cc3e9812439ee2faecd53f05199a1ec57d3a96e42208bf25a37ea1a3b0bd7ae | Cipherwraith/hblog | GenerateArchives.hs | module GenerateArchives where
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import System.FilePath
import Types
import Templates
import Data.Monoid
import Config
import ArchivedPosts
writeArchives :: [Publish] -> T.Text -> IO ()
writeArchives publish recent = do
htmlHead <- headerRaw
... | null | https://raw.githubusercontent.com/Cipherwraith/hblog/f92d96a60e301302c8a0e46fd68ee1e1810eb031/GenerateArchives.hs | haskell | module GenerateArchives where
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import System.FilePath
import Types
import Templates
import Data.Monoid
import Config
import ArchivedPosts
writeArchives :: [Publish] -> T.Text -> IO ()
writeArchives publish recent = do
htmlHead <- headerRaw
... | |
29acc2b1a460a096f86388f307b49f4b74311110550e60ee1fd8aaaf5ab26ad1 | racket/racket7 | windows.rkt | #lang racket/base
(require "sep.rkt")
(provide special-filename?
drive-letter?
letter-drive-start?
backslash-backslash-questionmark?
backslash-backslash-questionmark-kind
parse-backslash-backslash-questionmark
parse-unc
backslash-backslash-questionmark-dot... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/path/windows.rkt | racket | check for case-insensitive `fn` match followed by
'.' or ':' or (whitespace|'.')*
Returns #f, 'rel, 'red, or 'abs
Returns (values kind drive-len orig-drive-len clean-start-pos sep-bstr)
where `kind` is #f, 'rel, 'red, or 'abs
For 'abs, then `drive-len` is set to the length of the root
specification. For exampl... | #lang racket/base
(require "sep.rkt")
(provide special-filename?
drive-letter?
letter-drive-start?
backslash-backslash-questionmark?
backslash-backslash-questionmark-kind
parse-backslash-backslash-questionmark
parse-unc
backslash-backslash-questionmark-dot... |
4fa52c7951c31d431b7694bf927c0b5cb63d6aaf9998260db92d60a9d369aced | ericfinster/opetopictt | opetopictt.ml | (*****************************************************************************)
(* *)
(* Main module *)
(* *)
... | null | https://raw.githubusercontent.com/ericfinster/opetopictt/766a547b59280b4016657318d9fb486940b863da/bin/opetopictt.ml | ocaml | ***************************************************************************
Main module
****************... |
open Format
open Opetopictt.Io
open Opetopictt.Typecheck
let usage = "opetopictt [options] [file]"
let spec_list = []
let () =
let file_in = ref [] in
set_margin 80;
Arg.parse spec_list (fun s -> file_in := s::!file_in) usage;
let files = List.rev (!file_in) i... |
1435bf6b72518f1ec751a2d74b92dc70b1f0680d9bc5a73b60f6ef83cef98d4e | alonsodomin/haskell-schema | Schema.hs | {-# LANGUAGE RankNTypes #-}
module Data.Schema
( Field
, Fields
, field
, optional
, alt
, Schema
, HasSchema (..)
, prim
, const
, record
, asList
, toList
, oneOf
, alias
) where
import Control.Functor.HigherOrder
import ... | null | https://raw.githubusercontent.com/alonsodomin/haskell-schema/4f12bda9550e83000b9f886c1c12a8becb6ad7d7/hschema/src/Data/Schema.hs | haskell | # LANGUAGE RankNTypes #
| Define an alternative
| Define an annotated schema for primitives of type `p`
| Define a schema for a type that is always constant
| Define the schema of record using the given fields
| Define the schema of a list based on the element type
| Define the schema of an union (coproduct) type... |
module Data.Schema
( Field
, Fields
, field
, optional
, alt
, Schema
, HasSchema (..)
, prim
, const
, record
, asList
, toList
, oneOf
, alias
) where
import Control.Functor.HigherOrder
import Control.Lens
import ... |
7b11ebffb9c4cdb25b945961d2251ab805869799c0004bcf8cb73946ac2b9101 | mejgun/haskell-tdlib | Updates.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.Updates where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.Update as Update
import qualified Utils as U
-- |
data Updates = -- | Contains a list of updates @updates List of updates
Updates
{ -- |
update... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/beb6635177d7626b70fd909b1d89f2156a992cd2/src/TD/Data/Updates.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
| Contains a list of updates @updates List of updates
| |
module TD.Data.Updates where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.Update as Update
import qualified Utils as U
Updates
updates :: Maybe [Update.Update]
}
deriving (Eq)
instance Show Updates where
show
Updates
{ updates = updates_
... |
ec8fbba7a5a11b4f7f362a5266ae261e97bc698254514e20087db14174b8aadd | jlouis/erlang-utp | gen_utp_worker.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 ,
%%% @doc
%%%
%%% @end
Created : 19 Feb 2011 by < >
%%%-------------------------------------------------------------------
-module(gen_utp_worker).
-include("log.hrl").
-include("utp.hrl").
-behaviour(gen_... | null | https://raw.githubusercontent.com/jlouis/erlang-utp/fa6cbb8831b06e7f507779dcd7a0e2e94bdbff1a/src/gen_utp_worker.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
Internal API
gen_fsm callbacks
gen_fsm callback states
Default SYN packet timeout
Round trip time variance
@todo Probably dead!
Likewise!
Default add to the f... | @author < >
( C ) 2011 ,
Created : 19 Feb 2011 by < >
-module(gen_utp_worker).
-include("log.hrl").
-include("utp.hrl").
-behaviour(gen_fsm).
-export([start_link/4]).
Operations
-export([connect/1,
accept/2,
close/1,
recv/2,
send/2
]).
-export([
incoming/3,
reply/2
]).
-export([... |
7d85d4a61fce7c5f7079a370db4cba869d4ecf0bdd6cbf2fe9ea78b261114117 | pfdietz/ansi-test | bit-andc1.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Jan 26 18:56:39 2003
;;;; Contains: Tests of BIT-ANDC1
(deftest bit-andc1.1
(let* ((s1 (make-array nil :initial-element 0 :element-type 'bit))
(s2 (make-array nil :initial-element 0 :element-type 'bit)))
(values (bit-andc1 s1 s2) s1 s2))
#0... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/arrays/bit-andc1.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of BIT-ANDC1
Tests on bit vectors
Tests on bit arrays
Adjustable arrays
Displaced arrays
Random tests
Error tests | Author :
Created : Sun Jan 26 18:56:39 2003
(deftest bit-andc1.1
(let* ((s1 (make-array nil :initial-element 0 :element-type 'bit))
(s2 (make-array nil :initial-element 0 :element-type 'bit)))
(values (bit-andc1 s1 s2) s1 s2))
#0a0
#0a0
#0a0)
(deftest bit-andc1.2
(let* ((s1 (make... |
7e19b31789190a795211ce0cf56f41364ac182e73c06ad03807735fe193019fc | input-output-hk/marlowe-cardano | Spec.hs | module Main
( main
) where
import Spec.Actus.Examples
import Test.Tasty
main :: IO ()
main =
defaultMain $
testGroup
"ACTUS test cases"
[ testGroup
"ACTUS examples"
[ Spec.Actus.Examples.tests
]
]
| null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/78a3dbb1cd692146b7d1a32e1e66faed884f2432/marlowe-actus/test/Spec.hs | haskell | module Main
( main
) where
import Spec.Actus.Examples
import Test.Tasty
main :: IO ()
main =
defaultMain $
testGroup
"ACTUS test cases"
[ testGroup
"ACTUS examples"
[ Spec.Actus.Examples.tests
]
]
| |
12f044815ffb086493ab90e97e108d725d3d65c7b0ba54e7ca0927c3dbdf5241 | aeternity/aeternity | aemon_config.erl | -module(aemon_config).
%% API
-export([ privkey/0
, pubkey/0
, is_active/0
, amount/0
, autostart/0
, interval/0
, ttl/0
]).
%% ==================================================================
%% API
pubkey() ->
raw_key(<<"pubkey">>, publisher_pubkey, <<>... | null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aemon/src/aemon_config.erl | erlang | API
==================================================================
API
==================================================================
internal functions | -module(aemon_config).
-export([ privkey/0
, pubkey/0
, is_active/0
, amount/0
, autostart/0
, interval/0
, ttl/0
]).
pubkey() ->
raw_key(<<"pubkey">>, publisher_pubkey, <<>>).
privkey() ->
raw_key(<<"privkey">>, publisher_privkey, <<>>).
is_active() ... |
c69d9bcfabeba5f05eaa2412e4c12773be9628bcc706977e3fcc7b96b0b4cf57 | Mayvenn/storefront | blog.cljc | (ns homepage.ui.blog
(:require [clojure.string :refer [join split]]
[storefront.component :as c]
[storefront.components.ui :as ui]
[storefront.platform.component-utils :as utils]))
(c/defcomponent organism
[{:blog/keys [id target heading ucare-id date read-time beginning author]... | null | https://raw.githubusercontent.com/Mayvenn/storefront/e3fdf346cea341e9dc9a6e2c8c5c48529f966b22/src-cljc/homepage/ui/blog.cljc | clojure | (ns homepage.ui.blog
(:require [clojure.string :refer [join split]]
[storefront.component :as c]
[storefront.components.ui :as ui]
[storefront.platform.component-utils :as utils]))
(c/defcomponent organism
[{:blog/keys [id target heading ucare-id date read-time beginning author]... | |
dd2a63a5d2bc5eacf1cd64967119f6c82e572634c3b3e4128cb6226391fe245d | clojure-emacs/refactor-nrepl | four.clj | (ns com.example.four
(:require [clojure.string :refer [split join]]
[com.example.three :refer [fn-with-println thre]]
[com.example.twenty-four :refer [stuff more-stuff]]))
(defn some-fn-with-split []
(split "foo:bar:baz" #":"))
(def registry
{:fn-with-println #'fn-with-println})
(thre)
... | null | https://raw.githubusercontent.com/clojure-emacs/refactor-nrepl/8457b0341fdb220d4cba577ed150565e4d103364/testproject/src/com/example/four.clj | clojure | (ns com.example.four
(:require [clojure.string :refer [split join]]
[com.example.three :refer [fn-with-println thre]]
[com.example.twenty-four :refer [stuff more-stuff]]))
(defn some-fn-with-split []
(split "foo:bar:baz" #":"))
(def registry
{:fn-with-println #'fn-with-println})
(thre)
... | |
8920febb46f5bf6aae25a34b688ae315ddcc334acee7823faf938ecd75357f06 | orbitz/scow | scow_server_msg.mli | open Core.Std
open Async.Std
module Make :
functor (Statem : Scow_statem.S) ->
functor (Log : Scow_log.S) ->
functor (Transport : Scow_transport.S) ->
sig
type append_entries = (Statem.ret, [ `Not_master | `Append_failed | `Invalid_log ]) Result.t
type rpc = (Transport.Node.t, Transport.elt) Scow_trans... | null | https://raw.githubusercontent.com/orbitz/scow/feb633ef94824f44f0ffc679a548f97288c8ae48/lib/scow/scow_server_msg.mli | ocaml | open Core.Std
open Async.Std
module Make :
functor (Statem : Scow_statem.S) ->
functor (Log : Scow_log.S) ->
functor (Transport : Scow_transport.S) ->
sig
type append_entries = (Statem.ret, [ `Not_master | `Append_failed | `Invalid_log ]) Result.t
type rpc = (Transport.Node.t, Transport.elt) Scow_trans... | |
877cf31aa32ee4d9dcbe503f69b08d3020a2f723c251779c11a063ef2804d28c | cfcs/PongOS | command.ml | open Lwt
module Flow = Qubes.RExec.Flow
let src = Logs.Src.create "command" ~doc:"qrexec command handler"
module Log = (val Logs.src_log src : Logs.LOG)
let echo ~user flow =
Flow.writef flow "Hi %s! Please enter a string:" user >>= fun () ->
Flow.read_line flow >>= function
| `Eof -> return 1
| `Ok input ->... | null | https://raw.githubusercontent.com/cfcs/PongOS/45e1b64f00f6c06bee819770f2ed803c7e645f96/command.ml | ocaml | adapted from do_unpack in qubes-linux-utils/qrexec-lib/unpack.c
S_ISREG/S_ISLNK/S_ISDIR | open Lwt
module Flow = Qubes.RExec.Flow
let src = Logs.Src.create "command" ~doc:"qrexec command handler"
module Log = (val Logs.src_log src : Logs.LOG)
let echo ~user flow =
Flow.writef flow "Hi %s! Please enter a string:" user >>= fun () ->
Flow.read_line flow >>= function
| `Eof -> return 1
| `Ok input ->... |
8935faa4cdeba91d567571c1fbbc9b8150b80a4e72c979fe53f1164ea2fade73 | bennn/dissertation | lightbulb.rkt | #lang racket/base
;; License: Apache-2.0
By
;; <>
(require racket/draw
pict
racket/class
racket/math
racket/list
racket/contract)
(module+ main
(inset (lightbulb) 10))
(provide (contract-out
[lightbulb
(->* []
[#:color (or/c st... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/proposal/talk/lightbulb.rkt | racket | License: Apache-2.0
<>
| #lang racket/base
By
(require racket/draw
pict
racket/class
racket/math
racket/list
racket/contract)
(module+ main
(inset (lightbulb) 10))
(provide (contract-out
[lightbulb
(->* []
[#:color (or/c string? (is-a?/c color%) (is-a?... |
2d396588dc24520c2b762bbefae22e9ddc5dc34f63b266cc5fd961f901a45916 | mirage/ocaml-cstruct | bounds.ml |
* Copyright ( c ) 2014 Anil Madhavapeddy < >
* Copyright ( c ) 2013 Citrix Systems Inc
*
* 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 cop... | null | https://raw.githubusercontent.com/mirage/ocaml-cstruct/63ca7ccaf7cf4ad68bda1449027ac22b8af59745/lib_test/bounds.ml | ocaml | Check we can create and use an empty cstruct
Check that we can't create a cstruct with a negative length
Check we can shift in the +ve direction
Check that negative shifts are forbidden.
Check that an attempt to shift beyond the end of the buffer fails
Check that 'sub' works
Check that 'sub' can't set 'len... |
* Copyright ( c ) 2014 Anil Madhavapeddy < >
* Copyright ( c ) 2013 Citrix Systems Inc
*
* 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 cop... |
1920ba000466988d81b5ea0db04f554d064e45b06980d1ac4157002050492c31 | lojic/LearningRacket | day01-min.rkt | #lang racket
(require "../../advent/advent.rkt")
(define input (file->list "day01.txt"))
(define (count-increases lst)
(car (foldl (match-lambda* [ (list n (cons count last)) (cons (+ count (if (> n last) 1 0)) n) ])
(cons 0 (car lst))
(cdr lst))))
(define (windows-3 lst) (zipn lst (cd... | null | https://raw.githubusercontent.com/lojic/LearningRacket/00951818e2d160989e1b56cf00dfa38b55b6f4a9/advent-of-code-2021/solutions/day01/day01-min.rkt | racket | #lang racket
(require "../../advent/advent.rkt")
(define input (file->list "day01.txt"))
(define (count-increases lst)
(car (foldl (match-lambda* [ (list n (cons count last)) (cons (+ count (if (> n last) 1 0)) n) ])
(cons 0 (car lst))
(cdr lst))))
(define (windows-3 lst) (zipn lst (cd... | |
879d7e62796916f635c0367395f7f6b902eb06f7578395a8a2cd380b09fe2cf4 | spawnfest/eep49ers | wxBitmap.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxBitmap.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxBitmap).
-include("wxe.hrl").
-export([convertToImage/1,copyFromIcon/2,create/2,create/3,create/4,destroy/... |
babfb665e7b839db0dd5a1bffe5776ad895a47c1e3e6b2c4c96e7c87d100d27f | tweag/ormolu | forall-1.hs | {-# RULES "rd_tyvs" forall a. forall (x :: a). id x = x #-}
{-# RULES "rd_tyvs'" forall f a. forall (x :: f a). id x = x #-}
{-# RULES "rd_tyvs''" forall (a :: *). forall (x :: a). id x = x #-}
{-# RULES "rd_tyvs_multiline1"
forall (a :: *).
forall (x :: a).
id x = x #-}
{-# RULES "rd_tyvs_multiline2"
foral... | null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/rewrite-rule/forall-1.hs | haskell | # RULES "rd_tyvs" forall a. forall (x :: a). id x = x #
# RULES "rd_tyvs'" forall f a. forall (x :: f a). id x = x #
# RULES "rd_tyvs''" forall (a :: *). forall (x :: a). id x = x #
# RULES "rd_tyvs_multiline1"
forall (a :: *).
forall (x :: a).
id x = x #
# RULES "rd_tyvs_multiline2"
forall (a ::
*)... | |
6d27645be64ec54ff3a724072bc681b8bebe3129def0cb20987a6e5be6db7c06 | saleyn/etran | listcomp_test.erl | %% vim:ts=2:sw=2:et
-module(listcomp_test).
-compile({parse_transform, listcomp}).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
%%%-----------------------------------------------------------------------------
%%% Unit Tests
%%%------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/saleyn/etran/d77bbc26b886656b5717dae51b2b8ff701c56c60/test/listcomp_test.erl | erlang | vim:ts=2:sw=2:et
-----------------------------------------------------------------------------
Unit Tests
----------------------------------------------------------------------------- | -module(listcomp_test).
-compile({parse_transform, listcomp}).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-ifdef(EUNIT).
fold_test() ->
?assertEqual(6, [S+I || S = 0, I <- [1,2,3]]),
?assertEqual(6, [S+I || S = 0, {I,_} <- [{1,a},{2,b},{3,c}]]),
?assertEqual(4, [S+I || S = 0, I <- [... |
d1804c1c309d79ee67053d482b3c60730f74894617a85c26e6d4f960717ebceb | CatalaLang/catala | errors.ml | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... | null | https://raw.githubusercontent.com/CatalaLang/catala/07edff2cd2371581ba0e5664aa32bcf06650bd0e/compiler/catala_utils/errors.ml | ocaml | * Error formatting and helper functions
* The payload of the expression is a main error message, with a list of
secondary positions related to the error, each carrying an optional
secondary message to describe what is pointed by the position.
* {1 Warning printing} | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... |
0561485a9237fe5f7f108d480dad614f70cd4c04e0dfbe13db2ba70fffc0b900 | ghcjs/ghcjs | t7797.hs | # LANGUAGE ExistentialQuantification #
module Main where
import T7797a
data Box = forall a. (Size a) => Box a a
box = Box (go 10000000) (go 10000000) where
go :: Int -> [Int]
go 0 = []
go n = 1 : go (n - 1)
# NOINLINE box #
main = print $ case box of
Box l r -> size l r
| null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/perf/t7797.hs | haskell | # LANGUAGE ExistentialQuantification #
module Main where
import T7797a
data Box = forall a. (Size a) => Box a a
box = Box (go 10000000) (go 10000000) where
go :: Int -> [Int]
go 0 = []
go n = 1 : go (n - 1)
# NOINLINE box #
main = print $ case box of
Box l r -> size l r
| |
f88580ba307656c4413b7db6263675b988faa88260d92990b5a886339ef0bd53 | eugmes/imp | SourceLoc.hs | # LANGUAGE DeriveFunctor #
-- | Utilities for working with source locations.
module IMP.SourceLoc ( Located(..)
, WithLoc(..)
, SourcePos(..)
, initialPos
, withLoc
) where
import Text.Megaparsec.Pos
-- | Type @'L... | null | https://raw.githubusercontent.com/eugmes/imp/7bee4dcff146e041b0242b9e7054dfec4c04c84f/lib/IMP/SourceLoc.hs | haskell | | Utilities for working with source locations.
| Type @'Located' a@ represents values of type @a@ with source location
attached to them.
| @'WithLoc' m@ represents computations with associated source location.
* @'withNewLoc' p 'currentLoc' == 'pure' p@
@p@ set as context.
| Pure value containing current loca... | # LANGUAGE DeriveFunctor #
module IMP.SourceLoc ( Located(..)
, WithLoc(..)
, SourcePos(..)
, initialPos
, withLoc
) where
import Text.Megaparsec.Pos
data Located a = Located
{ getLoc :: SourcePos
... |
521fc83390f49bd2f53b9df52a997d19d5581b6591e5b995db7069a8146f50e9 | input-output-hk/hydra | HeadLogic.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
-- | Implements the Head Protocol's /state machine/ as a /pure function/.
--
The protocol is described in two parts in the [ Hydra paper]( / en / research / library / papers / hydrafast - isomorphic - state - channels/... | null | https://raw.githubusercontent.com/input-output-hk/hydra/54d6e4507fa4a67bb52a1507249e836e23e592bf/hydra-node/src/Hydra/HeadLogic.hs | haskell | | Implements the Head Protocol's /state machine/ as a /pure function/.
* Another part describing how the Head reacts to /network messages/ from peers.
* Types
TODO: Move logic up and types down or re-organize using explicit exports
| The different events which are processed by the head logic (the "core").
... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
The protocol is described in two parts in the [ Hydra paper]( / en / research / library / papers / hydrafast - isomorphic - state - channels/ )
* One part detailing how the Head deals with /client input/.
*... |
937fd8e70bb44ef9cf12dd4ba23c58c2831b673efe938f9a245658295dc4267f | tmfg/mmtis-national-access-point | buttons.cljs | (ns ote.ui.buttons
(:require [cljs-react-material-ui.reagent :as ui]
[ote.localization :refer [tr tr-key]]
[cljs-react-material-ui.core :refer [color]]
[cljs-react-material-ui.icons :as ic]
[stylefy.core :as stylefy]
[ote.style.base :as style-base]
... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/e36f9898bce005736e36153bdc7cca3386a44daf/ote/src/cljs/ote/ui/buttons.cljs | clojure | (ns ote.ui.buttons
(:require [cljs-react-material-ui.reagent :as ui]
[ote.localization :refer [tr tr-key]]
[cljs-react-material-ui.core :refer [color]]
[cljs-react-material-ui.icons :as ic]
[stylefy.core :as stylefy]
[ote.style.base :as style-base]
... | |
12c71da123d584ceb7060e025c94a7a1a0fe4c520878a466797e678015ecde76 | meain/evil-textobj-tree-sitter | textobjects.scm | (class_declaration
body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}"
)) @class.outer
(struct_declaration
body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}"
)) @class.outer
(method_declaration
body... | null | https://raw.githubusercontent.com/meain/evil-textobj-tree-sitter/866928d3ee6b4623addc2324f2eebe55e95dd778/queries/c_sharp/textobjects.scm | scheme | loops
conditionals
calls
blocks
parameters
comments | (class_declaration
body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}"
)) @class.outer
(struct_declaration
body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}"
)) @class.outer
(method_declaration
body... |
44c9cda1e4682af8e855fcf3086050befa19cd7f5bc64d90205eb1d0a33d9965 | utkarshkukreti/reaml | Reaml_Ppx_Bin.ml | open Migrate_parsetree
let _ = Driver.run_as_ppx_rewriter ()
| null | https://raw.githubusercontent.com/utkarshkukreti/reaml/5640a36293ba2a765171225deddb644f4d6c5d26/ppx/bin/Reaml_Ppx_Bin.ml | ocaml | open Migrate_parsetree
let _ = Driver.run_as_ppx_rewriter ()
| |
e08b8b1e7a58508ce7e9045c8ed112da2a4fed7c2f975fb99293fcb882035cbe | Kappa-Dev/KappaTools | fileNames.ml | (*file names*)
let input:(string list ref) = ref [] (*name of the kappa files*)
let output = ref "data.out"
| null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/parameters/fileNames.ml | ocaml | file names
name of the kappa files |
let output = ref "data.out"
|
0df23ae9f977203f8e7d050d944ce767fe412c23fcc0a89b5d7a9e7a41755870 | ml4tp/tcoq | indrec.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/pretyping/indrec.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Errors related to recursors buildi... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Env... |
3a0528fc98c7948f7d6b9390edb61b0a2e6f745f1f0be8a6be0acfce4d9d2295 | themetaschemer/malt | A-autodiff.rkt | #lang racket
(require "../tensors.rkt")
;;----------------------------
;; Reverse-mode AD
;;----------------------------
(define ∇
(λ (f theta)
(let ((wrt (map* dual* theta)))
(∇-once (f wrt) wrt))))
(define ∇¹
(λ (f)
(λ xs
(let ((wrt (map* dual* xs)))
(∇-once (apply f wrt) wrt)))))
... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/learner/autodiff/A-autodiff.rkt | racket | ----------------------------
Reverse-mode AD
----------------------------
----------------------------
General helpers
---------------------------- | #lang racket
(require "../tensors.rkt")
(define ∇
(λ (f theta)
(let ((wrt (map* dual* theta)))
(∇-once (f wrt) wrt))))
(define ∇¹
(λ (f)
(λ xs
(let ((wrt (map* dual* xs)))
(∇-once (apply f wrt) wrt)))))
(define ∇-once
(λ (y wrt)
(let ((σ (∇σ y (hasheq))))
(map* (λ (d)
... |
77c71d66eb46167038d5b2f9b682c9382003beab939fb70ebf76184b2466ccb3 | rpav/cl-gendoc | package.lisp | (defpackage :gendoc
(:use #:cl)
(:export #:gendoc #:define-gendoc-load-op
#:add-processor))
| null | https://raw.githubusercontent.com/rpav/cl-gendoc/c8fed7dd008a0cc34138521e45116e063aea33bd/package.lisp | lisp | (defpackage :gendoc
(:use #:cl)
(:export #:gendoc #:define-gendoc-load-op
#:add-processor))
| |
f0ae99fe2ffae0d490b26b235337ab5614cd76580b85edb1ec0c754e09b845be | deadpendency/deadpendency | Vector.hs | # OPTIONS_GHC -fno - warn - orphans #
module Common.HtmlReport.Instances.Vector
(
)
where
import Common.HtmlReport.HtmlReport
import Data.Vector qualified as V
import Data.Vector.NonEmpty qualified as NV
instance {-# OVERLAPPABLE #-} (ToHtmlReportBody a) => ToHtmlReportBody (NV.NonEmptyVector a) where
toHtmlRe... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/HtmlReport/Instances/Vector.hs | haskell | # OVERLAPPABLE #
# OVERLAPPABLE # | # OPTIONS_GHC -fno - warn - orphans #
module Common.HtmlReport.Instances.Vector
(
)
where
import Common.HtmlReport.HtmlReport
import Data.Vector qualified as V
import Data.Vector.NonEmpty qualified as NV
toHtmlReportBody = toHtmlReportBody . NV.toVector
toHtmlReportBody items
| V.null items = mempty
... |
9fc56ac2de36f264d6b57ef86642321a484f9fbf24ca1c75b7f177738383523b | kkinnear/zprint | guide.cljc | (ns ^:no-doc zprint.guide
#?@(:cljs [[:require-macros
[zprint.macros :refer
[dbg dbg-s dbg-pr dbg-s-pr dbg-form dbg-print zfuture]]]])
(:require #?@(:clj [[zprint.macros :refer
[dbg-pr dbg-s-pr dbg dbg-s dbg-form dbg-print zfuture]]])
[zprint.util :ref... | null | https://raw.githubusercontent.com/kkinnear/zprint/c5806b5c7a7455f626a0fd26a36367da94af09a6/src/zprint/guide.cljc | clojure |
Contains functions which can be called with {:option-fn <fn>} to produce
a "guide", which is, roughtly, a sequence comprised of keywords
which describe how to format an expression. A guide must be created
explicitly for the expression to be formatted.
For instance, this expression: (a b c d e f g) could be form... | (ns ^:no-doc zprint.guide
#?@(:cljs [[:require-macros
[zprint.macros :refer
[dbg dbg-s dbg-pr dbg-s-pr dbg-form dbg-print zfuture]]]])
(:require #?@(:clj [[zprint.macros :refer
[dbg-pr dbg-s-pr dbg dbg-s dbg-form dbg-print zfuture]]])
[zprint.util :ref... |
4657900a8b913731e87d0280785dc1ab9e8a28b27af358ca17576ad90c1798d6 | lambdamikel/DLMAPS | edge-management.lisp | ;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
(in-package :PROVER)
;;;
;;;
;;;
(timed-defmethod mark-deleted :after ((abox abox) (edge abox-edge))
t)
(timed-defmethod mark-deleted :after ((abox abox1) (edge abox-edge))
(with-slots (all-edges) abox
(if (not *use-avl-trees-for-abox1-p*)
... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/prover/edge-management.lisp | lisp | -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
|
(in-package :PROVER)
(timed-defmethod mark-deleted :after ((abox abox) (edge abox-edge))
t)
(timed-defmethod mark-deleted :after ((abox abox1) (edge abox-edge))
(with-slots (all-edges) abox
(if (not *use-avl-trees-for-abox1-p*)
(setf all-edges (delete edge all-edges))
(delete-from-avl-tree e... |
6ca2291a253593096231c17c8c6ec108ff09462972edab95738e5afa68ad6832 | input-output-hk/plutus | Substitute.hs | -- editorconfig-checker-disable-file
# LANGUAGE FlexibleContexts #
# LANGUAGE ViewPatterns #
-- | Implements naive substitution functions for replacing type and term variables.
module PlutusIR.Transform.Substitute (
substVar
, substTyVar
, typeSubstTyNames
, termSubstNames
, termSubstTyNames
... | null | https://raw.githubusercontent.com/input-output-hk/plutus/c8d4364d0e639fef4d5b93f7d6c0912d992b54f9/plutus-core/plutus-ir/src/PlutusIR/Transform/Substitute.hs | haskell | editorconfig-checker-disable-file
| Implements naive substitution functions for replacing type and term variables.
| Replace a variable using the given function.
| Naively substitute names using the given functions (i.e. do not substitute binders).
| Naively substitute type names using the given functions (i.e. do... | # LANGUAGE FlexibleContexts #
# LANGUAGE ViewPatterns #
module PlutusIR.Transform.Substitute (
substVar
, substTyVar
, typeSubstTyNames
, termSubstNames
, termSubstTyNames
, bindingSubstNames
, bindingSubstTyNames
) where
import PlutusIR
import PlutusCore.Subst (substTyVar, type... |
25ec910d650797543430541d99ec3b98d3cb0c5e9c1eba7773306d43b80bf916 | abdulapopoola/SICPBook | 5.34.scm | (load "compiler.scm")
(define code (compile
'(define (factorial n)
(define (iter product counter)
(if (> counter n)
product
(iter (* counter product)
(+ counter 1))))
(iter 1 1)... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%205/5.5/5.34.scm | scheme | OUTPUT BELOW | (load "compiler.scm")
(define code (compile
'(define (factorial n)
(define (iter product counter)
(if (> counter n)
product
(iter (* counter product)
(+ counter 1))))
(iter 1 1)... |
5a095725582b5d1d69a9b0e8599b858e6930e40e97f2afcadf8934553f216365 | pirapira/coq2rust | tacmach.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/proofs/tacmach.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 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Util
open Namegen
open T... |
52d3cabfe63224b58d122f340c4719441f851512b7257d7e7242a3e02da42564 | codinuum/cca | stat.ml |
Copyright 2012 - 2022 Codinuum Software Lab < >
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 wri... | null | https://raw.githubusercontent.com/codinuum/cca/3d97b64a5c23ff97c08455ac604ccb9fed471d91/src/ast/analyzing/common/stat.ml | ocaml | stat.ml
WARN_MSG s;
s.s_relabels_gr
module Stat.File
module Stat.Dir |
Copyright 2012 - 2022 Codinuum Software Lab < >
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 wri... |
8f98eb7cec2b2403d72bfa3e3a581e1480b4ba76295da4cad58febdad779d191 | alang9/dynamic-graphs | Splay.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiWayIf #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Data.Graph.Dynamic.Internal.Splay
( Tree
... | null | https://raw.githubusercontent.com/alang9/dynamic-graphs/b88f001850c7bee8faa62099e93172a0bb0df613/src/Data/Graph/Dynamic/Internal/Splay.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE CPP #
# LANGUAGE MultiWayIf #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeSynonymInstances #
* Debugging only
# UNPACK #
# UNPACK #
# UNPACK #
right is not set (we want to avoid Maybe's since they cause a lo... | # LANGUAGE RecordWildCards #
module Data.Graph.Dynamic.Internal.Splay
( Tree
, singleton
, cons
, snoc
, append
, split
, connected
, root
, aggregate
, toList
, readRoot
, freeze
, print
, assertInvariants
) where
import Control.Monad ... |
42161011265010e40e8135c579bdf306136d1959accd3e8eea5c6d942fb0824f | BinaryAnalysisPlatform/bap | arm_branch.ml | open Core_kernel[@@warning "-D"]
open Bap.Std
open Or_error
open Arm_types
open Arm_utils
module Env = Arm_env
let pc_offset = Word.(of_int 8 ~width:32) (* PC is ahead by some bytes in ARM *)
let word = Word.of_int ~width:32
let lift operand ?link ?x:_ ?cond addr =
let target =
match operand with
... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/arm/arm_branch.ml | ocaml | PC is ahead by some bytes in ARM | open Core_kernel[@@warning "-D"]
open Bap.Std
open Or_error
open Arm_types
open Arm_utils
module Env = Arm_env
let word = Word.of_int ~width:32
let lift operand ?link ?x:_ ?cond addr =
let target =
match operand with
| `Reg r -> Bil.var (Env.of_reg r)
| `Imm offset ->
let width = Word.bitwidth o... |
ab33e77a0eff8ee0710c9d8ac417958d6c2a91c5f8ed5e8922d5af566afefad6 | juspay/atlas | Handler.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/parking-bap/src/API/Parking/Booking/BookingList/Handler.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
cf8e64109ca50d3d4a825fabc24ae26421ffc0e8dd59a69107523d797f3d6464 | simoncourtenage/quanthas | Paths_QuantHas.hs | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - import - lists #
# OPTIONS_GHC -fno - warn - implicit - prelude #
module Paths_QuantHas (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Ver... | null | https://raw.githubusercontent.com/simoncourtenage/quanthas/6e0b2cc9a60bb7d1709f98ed10d09aa6c071c8dd/dist/build/autogen/Paths_QuantHas.hs | haskell | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - import - lists #
# OPTIONS_GHC -fno - warn - implicit - prelude #
module Paths_QuantHas (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Ver... | |
5d45c73832ae2a6ca0e89234a535a4004d2e2055de3d124fba85e27b27438c40 | emaphis/HtDP2e-solutions | ex081.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex081) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f ... | null | https://raw.githubusercontent.com/emaphis/HtDP2e-solutions/ecb60b9a7bbf9b8999c0122b6ea152a3301f0a68/1-Fixed-Size-Data/05-Adding-Structure/ex081.rkt | racket | about the language level of this file in a form that our tools can easily process.
Design the function time->seconds, which consumes instances of time
structures and produces the number of seconds that have passed since
midnight.
timet is a (make-time Number Number Number))
Time -> Number
convert a given time to... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex081) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
Ex . 81 :
For example , if you are representing 12 hours , 30 ... |
2d283e407b1110a62d9ec0a5fd41a0c8bad92929925921c2855304b6931787df | ghcjs/jsaddle-dom | SVGTransformList.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGTransformList
(clear, initialize, initialize_, getItem, getItem_,
insertItemBefore, insertItemBefore_, r... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/SVGTransformList.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/SVGTransformList.clear Mozilla SVGTransformList.clear documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGTransformList
(clear, initialize, initialize_, getItem, getItem_,
insertItemBefore, insertItemBefore_, replaceItem, replaceItem_,
removeItem, removeItem_, appendItem, appendItem_,
createS... |
07f1b3feae305363798479882282fb8791f26b0456fbc6a896df496bdad6027c | ghcjs/ghcjs-boot | hGetLine003.hs | import System.IO
main = f stdin
where f h = do p <- hIsEOF h
if p then putStrLn "done"
else do l <- hGetLine h
putStrLn l
f h
| null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/tests/IO/hGetLine003.hs | haskell | import System.IO
main = f stdin
where f h = do p <- hIsEOF h
if p then putStrLn "done"
else do l <- hGetLine h
putStrLn l
f h
| |
8135f247db2bd4b5c63e969c5486f1c268eda7f21c12e290585748064324a623 | threatgrid/asami | encoder.clj | (ns ^{:doc "Encodes and decodes data for storage. Clojure implementation"
:author "Paula Gearon"}
asami.durable.encoder
(:require [clojure.string :as s]
[asami.graph :as graph]
[asami.durable.codec :refer [byte-mask data-mask sbytes-shift len-nybble-shift utf8
... | null | https://raw.githubusercontent.com/threatgrid/asami/d3f1741ad368e25a3100eff280d38350b98cfe70/src/asami/durable/encoder.clj | clojure | Refer to asami.durable.codec for a description of the encoding implemented below
(set! *warn-on-reflection* true)
to-counted-bytes is required by the recursive concattenation operation
start with the top byte set to the type nybble and the length
If this is an identified object, then save its location
only look f... | (ns ^{:doc "Encodes and decodes data for storage. Clojure implementation"
:author "Paula Gearon"}
asami.durable.encoder
(:require [clojure.string :as s]
[asami.graph :as graph]
[asami.durable.codec :refer [byte-mask data-mask sbytes-shift len-nybble-shift utf8
... |
bc1b07553ebd16c1075782f7510f3c6d46b995e804921fe057991a3ca73c22db | bennn/dissertation | array-sequence.rkt | #lang racket/base
(require (for-syntax racket/base)
typed/untyped-utils
typed-racket/base-env/prims
racket/unsafe/ops
"array-struct.rkt"
"utils.rkt"
(except-in "typed-array-sequence.rkt" in-array-indexes))
(require/untyped-contract
"typed-array-sequence.rkt"
[in... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/QA/math-test/array-map/transient/math/private/array/array-sequence.rkt | racket | #lang racket/base
(require (for-syntax racket/base)
typed/untyped-utils
typed-racket/base-env/prims
racket/unsafe/ops
"array-struct.rkt"
"utils.rkt"
(except-in "typed-array-sequence.rkt" in-array-indexes))
(require/untyped-contract
"typed-array-sequence.rkt"
[in... | |
bf1e0026fb5f409f2aea9c071dd93f7be7eb54f5f77a52dad84292384e830383 | ptal/AbSolute | tast.ml | Copyright 2019
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... | null | https://raw.githubusercontent.com/ptal/AbSolute/469159d87e3a717499573c1e187e5cfa1b569829/src/lang/typing/tast.ml | ocaml | Copyright 2019
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... | |
b95dff77beabc4571fe89ffbe8cc0fe1a100b6b3e413244fa98bc4d38971e84f | juxt/site | util.clj | Copyright © 2021 , JUXT LTD .
(ns juxt.site.alpha.util
(:require
[juxt.clojars-mirrors.nippy.v3v1v1.taoensso.nippy.utils :refer [freezable?]]))
(alias 'site (create-ns 'juxt.site.alpha))
(alias 'http (create-ns 'juxt.http.alpha))
(defn assoc-when-some [m k v]
(cond-> m v (assoc k v)))
TODO find out what is... | null | https://raw.githubusercontent.com/juxt/site/ba44b0241931c5f2e2228aae68006a858333bc65/src/juxt/site/alpha/util.clj | clojure | Copyright © 2021 , JUXT LTD .
(ns juxt.site.alpha.util
(:require
[juxt.clojars-mirrors.nippy.v3v1v1.taoensso.nippy.utils :refer [freezable?]]))
(alias 'site (create-ns 'juxt.site.alpha))
(alias 'http (create-ns 'juxt.http.alpha))
(defn assoc-when-some [m k v]
(cond-> m v (assoc k v)))
TODO find out what is... | |
6e3b9a7aa2596b3d372ae4c713e75c8c1a48852c4e717ab2f92c025e4deea34c | jaspervdj/advent-of-code | 14.hs | # LANGUAGE BangPatterns #
# LANGUAGE DeriveFunctor #
{-# LANGUAGE LambdaCase #-}
import AdventOfCode.Main
import qualified AdventOfCode.NanoParser as P
import Control.Applicative ((<|>))
import Data.Bits (shiftL, testBit)
import Data.List (fol... | null | https://raw.githubusercontent.com/jaspervdj/advent-of-code/bdc9628d1495d4e7fdbd9cea2739b929f733e751/2020/14.hs | haskell | # LANGUAGE LambdaCase # | # LANGUAGE BangPatterns #
# LANGUAGE DeriveFunctor #
import AdventOfCode.Main
import qualified AdventOfCode.NanoParser as P
import Control.Applicative ((<|>))
import Data.Bits (shiftL, testBit)
import Data.List (foldl')
import Data.Mono... |
3df795361bcee93b51c6761c62b74d05b3b05b7bc7298b2231c4853e335731a7 | returntocorp/semgrep | Matching_report.ml |
*
* Copyright ( C ) 2013 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICENS... | null | https://raw.githubusercontent.com/returntocorp/semgrep/dea6ebd8e95d696c04b53c10e019f72dd8908a83/src/reporting/Matching_report.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
*
* Copyright ( C ) 2013 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICENS... |
3c46c335e4d305abbd8dff7654b61faf249e6f11b60b8b01654620cf0cc8576d | janestreet/bonsai | protocol.mli | open! Core
open! Async_rpc_kernel
module Message_stream : sig
val t : (unit, Message.t, unit) Rpc.Pipe_rpc.t
end
module Messages_request : sig
val t : (Room.t, Message.t list) Rpc.Rpc.t
end
module Send_message : sig
val t : (Message.t, unit Or_error.t) Rpc.Rpc.t
end
module Create_room : sig
val t : (Room.t,... | null | https://raw.githubusercontent.com/janestreet/bonsai/761d04847d5f947318b64c0a46dffa17ad413536/examples/open_source/rpc_chat/common/protocol.mli | ocaml | open! Core
open! Async_rpc_kernel
module Message_stream : sig
val t : (unit, Message.t, unit) Rpc.Pipe_rpc.t
end
module Messages_request : sig
val t : (Room.t, Message.t list) Rpc.Rpc.t
end
module Send_message : sig
val t : (Message.t, unit Or_error.t) Rpc.Rpc.t
end
module Create_room : sig
val t : (Room.t,... | |
05ce22f9916d31108635ee004e03707229910c68e8e6e2d2602b1bb6243a8cc8 | craigfe/compact | uniform_array.ml | — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Copyright ( c ) 2016–2020 Jane Street Group , LLC < >
Copyright ( c ) 2020–2021 < >
Distributed under the MIT license . See terms at the end of this ... | null | https://raw.githubusercontent.com/craigfe/compact/fcce0432d267babeb90dbdf4f49e2d2d067b2b0f/src/uniform_array.ml | ocaml | WARNING:
We use non-memory-safe things throughout the [Trusted] module.
Most of it is only safe in combination with the type signature (e.g. exposing
[val copy : 'a t -> 'b t] would be a big mistake).
We start at [len - 2] because we already put [a] at [t.(len - 1)].
It is not safe for [to_array] to be th... | — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Copyright ( c ) 2016–2020 Jane Street Group , LLC < >
Copyright ( c ) 2020–2021 < >
Distributed under the MIT license . See terms at the end of this ... |
5625d28e563a1c0b3a7984ab7057cffbe7d3c7d6183c12eefd9c26ffcd3b7fb0 | crategus/cl-cffi-gtk | rtest-gdk-event-structures.lisp | (def-suite gdk-event-structures :in gdk-suite)
(in-suite gdk-event-structures)
;;; GdkScrollDirection
(test gdk-scroll-direction
;; Check the type
(is-true (g-type-is-enum "GdkScrollDirection"))
;; Check the type initializer
(is (eq (gtype "GdkScrollDirection")
(gtype (foreign-funcall "gdk_scrol... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/da748ec5300141e9f07aabeeab7a9acb2b37ecf2/test/rtest-gdk-event-structures.lisp | lisp | GdkScrollDirection
Check the type
Check the type initializer
Check the registered name
Check the names
Check the values
Check the enum definition
GdkVisibilityState
Check the type
Check the type initializer
Check the registered name
Check the names
Check the values
Check the enum definition
G... | (def-suite gdk-event-structures :in gdk-suite)
(in-suite gdk-event-structures)
(test gdk-scroll-direction
(is-true (g-type-is-enum "GdkScrollDirection"))
(is (eq (gtype "GdkScrollDirection")
(gtype (foreign-funcall "gdk_scroll_direction_get_type" g-size))))
(is (eq 'gdk-scroll-direction
(reg... |
8d3644020b30f1d27f62873bd0fcb4f1d8463de153cd58da18f6bcb787d63cb8 | ragkousism/Guix-on-Hurd | display-managers.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 < >
Copyright © 2014 < >
Copyright © 2014 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Fre... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/display-managers.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 < >
Copyright © 2014 < >
Copyright © 2014 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages display-managers)
#:use-module ... |
89ab0a0d47c459ad9d41fd74fe26fdcb60d902a4d5b465bd8e9b9f9c77115423 | mlabs-haskell/apropos | Generator.hs | module Apropos.Generator (
runTest,
decorateTests,
selfTest,
selfTestWhere,
) where
import Apropos.Description (
Description (describe, genDescribed),
scenarios,
variablesToDescription,
)
import Data.Bifunctor (first)
import Data.Kind (Type)
import Data.Map (Map)
import Data.Map qualified as Map
import ... | null | https://raw.githubusercontent.com/mlabs-haskell/apropos/17bb6f7b05549fd7ce67f99b5473d19bba93e6b8/src/Apropos/Generator.hs | haskell | | Like 'selfTest', but you can filter which descriptions are tested. | module Apropos.Generator (
runTest,
decorateTests,
selfTest,
selfTestWhere,
) where
import Apropos.Description (
Description (describe, genDescribed),
scenarios,
variablesToDescription,
)
import Data.Bifunctor (first)
import Data.Kind (Type)
import Data.Map (Map)
import Data.Map qualified as Map
import ... |
4e1e6b0420e6545d32d54c5a65faffaeaa248fff65dacdb1a3ee8b64a722ab7e | iu-parfunc/HSBencher | Dribble.hs | # LANGUAGE RecordWildCards , TypeFamilies , NamedFieldPuns , DeriveDataTypeable #
-- | A simple backend that dribbles benchmark results (i.e. rows/tuples) into a
-- series of files in an "hsbencher" subdir of the the users ".cabal/" directory.
--
-- This is often useful as a failsafe to reinforce other backends that d... | null | https://raw.githubusercontent.com/iu-parfunc/HSBencher/76782b75b3a4b276c45a2c159e0b4cb6bd8a2360/hsbencher/src/HSBencher/Backend/Dribble.hs | haskell | | A simple backend that dribbles benchmark results (i.e. rows/tuples) into a
series of files in an "hsbencher" subdir of the the users ".cabal/" directory.
This is often useful as a failsafe to reinforce other backends that depend on
connecting to internet services for upload. Even if the upload fails, you still
... | # LANGUAGE RecordWildCards , TypeFamilies , NamedFieldPuns , DeriveDataTypeable #
module HSBencher.Backend.Dribble
( defaultDribblePlugin,
DribblePlugin(), DribbleConf(..)
)
where
import HSBencher.Types
import HSBencher.Internal.Logging (log)
import Control.Concurrent.MVar
import Control.M... |
154de379d5f5edfc866b46735395ad5d46a754433bbb3201753ec685b44fd8d7 | deadpendency/deadpendency | GHAppRawPrivateKey.hs | module Common.Model.GitHub.GHAppRawPrivateKey
( GHAppRawPrivateKey (..),
)
where
newtype GHAppRawPrivateKey = GHAppRawPrivateKey
{ _ntByteString :: ByteString
}
deriving stock (Eq, Show, Generic)
| null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Model/GitHub/GHAppRawPrivateKey.hs | haskell | module Common.Model.GitHub.GHAppRawPrivateKey
( GHAppRawPrivateKey (..),
)
where
newtype GHAppRawPrivateKey = GHAppRawPrivateKey
{ _ntByteString :: ByteString
}
deriving stock (Eq, Show, Generic)
| |
e7b0049d6496895c79ad6dedef6b34b92569b86b4b56611b5ab3f13d433d504d | caribou/caribou-core | asset.clj | (ns caribou.field.asset
(:require [caribou.util :as util]
[caribou.validation :as validation]
[caribou.asset :as asset]
[caribou.field :as field]
[caribou.db :as db]
[caribou.association :as assoc]))
(defn asset-fusion
[this prefix archetype skein opts]
... | null | https://raw.githubusercontent.com/caribou/caribou-core/6ebd9db4e14cddb1d6b4e152e771e016fa9c55f6/src/caribou/field/asset.clj | clojure | (ns caribou.field.asset
(:require [caribou.util :as util]
[caribou.validation :as validation]
[caribou.asset :as asset]
[caribou.field :as field]
[caribou.db :as db]
[caribou.association :as assoc]))
(defn asset-fusion
[this prefix archetype skein opts]
... | |
2bbc7e19ca3e890bacdc7ce16015da1c904d5b400bb4bca06ce2d58310092437 | dgtized/shimmers | particles.cljs | (ns shimmers.sketches.particles
"Loosely derived from Coding Challenge #24: Perlin Noise Flow Field
"
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[quil.sketch]
[shimmers.common.framerate :as framerate]
[shimmers.common.particle-system :as particles]
[shimmers.common.... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/particles.cljs | clojure | :color (color/random)
(tm/+ velocity (g/scale velocity -0.1))
Because of discontinuity when noise wraps around, there were often competing
forces at the borders. We fix this by reflecting x and y coordinates around
the halfway point for the purposes of calculating noise to ensure they are
continuous at edges.
Pr... | (ns shimmers.sketches.particles
"Loosely derived from Coding Challenge #24: Perlin Noise Flow Field
"
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[quil.sketch]
[shimmers.common.framerate :as framerate]
[shimmers.common.particle-system :as particles]
[shimmers.common.... |
e77b204d6673e3a0fc86c648a7a14074f6eef137a657d45723346cf75f92cf7a | junjihashimoto/hugs-js | JsWrapper.hs | # LANGUAGE ForeignFunctionInterface #
module JsWrapper where
import Foreign.C.String
import Foreign.Ptr
--import Hugs.Prelude
{-# CFILES jswrapper.c #-}
typedef void ( * ) ;
--extern void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop);
foreign import ccall "emscripten.h" emsc... | null | https://raw.githubusercontent.com/junjihashimoto/hugs-js/5a38dbe8310b5d56746ec83c24f7a9f520fbdcd3/sample/JsWrapper.hs | haskell | import Hugs.Prelude
# CFILES jswrapper.c #
extern void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop);
print "callbackC"
print "withcstring"
print "withcstring" | # LANGUAGE ForeignFunctionInterface #
module JsWrapper where
import Foreign.C.String
import Foreign.Ptr
typedef void ( * ) ;
foreign import ccall "emscripten.h" emscripten_run_script :: CString -> IO ()
foreign import ccall "emscripten.h" emscripten_set_main_loop :: (FunPtr (IO ())) -> Int -> Int -> IO ();
emRun... |
a54a5b06b55771c70f8f0a51b111d32ae94632a0f7de9cefd58e90109614dbe4 | cedlemo/OCaml-GI-ctypes-bindings-generator | Pad_action_type.mli | open Ctypes
type t = Button | Ring | Strip
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Pad_action_type.mli | ocaml | open Ctypes
type t = Button | Ring | Strip
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| |
c5a43b24ae50cb7105a6ac721f91e4688be50c6570175786bab782b954e970fc | vmchale/atspkg | C.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE TypeFamilies #-}
-- | This module provides functions for easy C builds of binaries, static
-- libraries, and dynamic libraries.
module Development.Shake.C ( -- * Types
... | null | https://raw.githubusercontent.com/vmchale/atspkg/45be7ece6b9e9b09a7151efe53ff7e278112e84d/shake-c/src/Development/Shake/C.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE TypeFamilies #
| This module provides functions for easy C builds of binaries, static
libraries, and dynamic libraries.
* Types
* Rules
* Oracles
* Actions
* Helper functions
| Given a package name or path to a @.pc@ file, output f... | # LANGUAGE DeriveGeneric #
CConfig (..)
, CCompiler (..)
, staticLibR
, sharedLibR
, objectFileR
, dynLibR
, cBin
... |
55e682a54c4057f15749e7d260ccded375412dfb224c7a79a80cdfa547dbc02f | albertoruiz/easyVision | single.hs | import Vision.GUI
import Image.Processing
import Image.Capture
import System.Environment
f = sumPixels . grayscale . channelsFromRGB
main = getArgs >>= readImages >>= runITrans (arr f) >>= print
| null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/tour/single.hs | haskell | import Vision.GUI
import Image.Processing
import Image.Capture
import System.Environment
f = sumPixels . grayscale . channelsFromRGB
main = getArgs >>= readImages >>= runITrans (arr f) >>= print
| |
ff396ee4e3352105bc507065d06fdad1d701e68388919dfa12f93c5c6c0dedf9 | transient-haskell/transient-stack | api.hs | #!/usr/bin/env ./execthirdline.sh
set -e & & port=`echo $ { 3 } | awk -F/ ' { print $ ( 3 ) } ' ` & & docker run -it -p $ { port}:${port } -v /c / Users / magocoal / OneDrive / Haskell / devel:/devel testtls bash -c " cd /devel / transient - universe - tls / tests/ ; -j2 -isrc -i / devel / transient / src -i /... | null | https://raw.githubusercontent.com/transient-haskell/transient-stack/dde6f6613a946d57bb70879a5c0e7e5a73a91dbe/transient-universe-tls/tests/api.hs | haskell | compile it with ghcjs and execute it with runghc
data " birthyear=1905&press=%20OK%20 "
data "birthyear=1905&press=%20OK%20"
<|> err | #!/usr/bin/env ./execthirdline.sh
set -e & & port=`echo $ { 3 } | awk -F/ ' { print $ ( 3 ) } ' ` & & docker run -it -p $ { port}:${port } -v /c / Users / magocoal / OneDrive / Haskell / devel:/devel testtls bash -c " cd /devel / transient - universe - tls / tests/ ; -j2 -isrc -i / devel / transient / src -i /... |
28bb94d398391295af50f0a7367457808130b6fed83c118306fcd764137d4f49 | polysemy-research/polysemy | NonDet.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE TemplateHaskell #
-- | Description: Interpreters for 'NonDet'
module Polysemy.NonDet
( -- * Effect
NonDet (..)
-- * Interpretations
, runNonDet
, runNonDetMaybe
, nonDetToError
) where
import Control.Applicative
import Control.Monad.Trans.Maybe
import Dat... | null | https://raw.githubusercontent.com/polysemy-research/polysemy/10a1336f32438c2d308313f8ad55ac736145390f/src/Polysemy/NonDet.hs | haskell | # LANGUAGE DeriveAnyClass #
| Description: Interpreters for 'NonDet'
* Effect
* Interpretations
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Unlike 'runNonDet', uses of '<|>' will not execute the
@since ... | # LANGUAGE TemplateHaskell #
module Polysemy.NonDet
NonDet (..)
, runNonDet
, runNonDetMaybe
, nonDetToError
) where
import Control.Applicative
import Control.Monad.Trans.Maybe
import Data.Maybe
import Polysemy
import Polysemy.Error
import Polysemy.Internal
import Polysemy.Internal.NonDet
import Polysem... |
51150886e2f44e2cfaba33e8a5339019d87845547a8a5537cdd33f4d4c12d5e2 | soegaard/cairo | dot-method.rkt | #lang racket/base
(require racket/match racket/list racket/class
(for-syntax racket/base syntax/parse racket/syntax
racket/string))
(provide
dot-field
dot-assign-field
declare-struct-fields
app-dot-method
define-method
:=
;apply-dot-method
; get-dot-method
; define-method
dot-to... | null | https://raw.githubusercontent.com/soegaard/cairo/cac25d351af234e0af935bfe138c397dca49fc1a/cairo-test/dot-method.rkt | racket | apply-dot-method
get-dot-method
define-method
calls to a o.m is a method call
calls to an f is a normal call
(display ".")
Dot Fields and Methods
we would like to write
in order to draw the circle. Here circle is the draw-a-circle
primitive provided by Sketching.
We can now write:
(define (draw-ci... | #lang racket/base
(require racket/match racket/list racket/class
(for-syntax racket/base syntax/parse racket/syntax
racket/string))
(provide
dot-field
dot-assign-field
declare-struct-fields
app-dot-method
define-method
:=
dot-top
dot-app
)
(define-syntax (dot-app stx)
(syntax... |
990942f78d9275990e41130cad18426467f5e7f4201c57f3432c629bfb16a48c | haskell-opengl/OpenGL | TextureUnit.hs | {-# OPTIONS_HADDOCK hide #-}
--------------------------------------------------------------------------------
-- |
Module : Graphics . Rendering . OpenGL.GL.Texturing . TextureUnit
Copyright : ( c ) 2002 - 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portabilit... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGL/f7af8fe04b0f19c260a85c9ebcad612737cd7c8c/src/Graphics/Rendering/OpenGL/GL/Texturing/TextureUnit.hs | haskell | # OPTIONS_HADDOCK hide #
------------------------------------------------------------------------------
|
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
--------------------------------------------------------------... | Module : Graphics . Rendering . OpenGL.GL.Texturing . TextureUnit
Copyright : ( c ) 2002 - 2019
Maintainer : < >
This is a purely internal module for ( un-)marshaling TextureUnit .
module Graphics.Rendering.OpenGL.GL.Texturing.TextureUnit (
TextureUnit(..), marshalTextureUnit, unmarsha... |
800c54a8a2bd2a6c98ffd9b67becb319dd1a7256fe4ed5deb8c3e789bc8ef992 | avillega/generative-art | circle_packing.clj | (ns generative-artistry.circle-packing
(:require [quil.core :as q]
[quil.middleware :as m]
[generative-artistry.utils :refer :all]))
(def ratio 0.3)
(defn collide? [{x1 :x y1 :y r1 :r stroke1 :stroke}
{x2 :x y2 :y r2 :r stroke2 :stroke}]
(let [x (- x1 x2)
y (- y1 y2... | null | https://raw.githubusercontent.com/avillega/generative-art/cd3be0a40ff9a7972b875df0e9e8f6981e45ee40/src/generative_artistry/circle_packing.clj | clojure | (ns generative-artistry.circle-packing
(:require [quil.core :as q]
[quil.middleware :as m]
[generative-artistry.utils :refer :all]))
(def ratio 0.3)
(defn collide? [{x1 :x y1 :y r1 :r stroke1 :stroke}
{x2 :x y2 :y r2 :r stroke2 :stroke}]
(let [x (- x1 x2)
y (- y1 y2... | |
5f4a7b5823c4922d9d5cc218d0e59932d491a119fa188f03d985827ca9ad0c65 | brendanhay/terrafomo | Resources.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
Module : . Gitlab . Resources
Copyright : ( c ) 2017 - 2018
License :... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-gitlab/gen/Terrafomo/Gitlab/Resources.hs | haskell | This module is auto-generated.
|
Stability : auto-generated
* gitlab_deploy_key
* gitlab_group
* gitlab_label
* gitlab_project_hook
* gitlab_project_membership
* gitlab_project
* gitlab_user
| The main @gitlab_deploy_key@ resource definition.
^ @can_push@
- (Default __@false@__, Forces New)
^ @key@
- ... |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
Module : . Gitlab . Resources
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Ma... |
cbf0ad37774e331137aa1de2b1523bf8d43ecdc25d5a75aa05b25fbd1ae3903f | mauricioszabo/paprika | byte_array.clj | (ns paprika.io.byte-array
(:refer-clojure :exclude [slurp spit])
(:require [clojure.java.io :as io])
(:import [java.io ByteArrayOutputStream ByteArrayInputStream]))
(defn slurp
"Reads a binary file and returns a byte array instead of a string"
[file-name]
(let [in (io/input-stream file-name)
out (B... | null | https://raw.githubusercontent.com/mauricioszabo/paprika/b1923abb581ab12ce00971fa4e184c0974602ef9/src/paprika/io/byte_array.clj | clojure | (ns paprika.io.byte-array
(:refer-clojure :exclude [slurp spit])
(:require [clojure.java.io :as io])
(:import [java.io ByteArrayOutputStream ByteArrayInputStream]))
(defn slurp
"Reads a binary file and returns a byte array instead of a string"
[file-name]
(let [in (io/input-stream file-name)
out (B... | |
eabc989d0b585cfb99fa27313451b72b6666c9320cbc88bdb96fd2d976c44f26 | stchang/lazyprofile-tool | deque-implicit-profiled.rkt | #lang s-exp "../../lazy-profile.rkt"
(struct Zero ())
(struct One (elem))
(struct Two (first second))
(struct Three (first second third))
( define - type ( D A ) ( U Zero ( One A ) ( Two A ) ( Three A ) ) )
( define - type ( D1 A ) ( U Zero ( One A ) ( Two A ) ) )
(struct Shallow (elem))
(struct Deep (F M R))
... | null | https://raw.githubusercontent.com/stchang/lazyprofile-tool/f347cbe6e91f671320d025d9217dfe1795b8d0f0/examples-popl2014/okasaki/deque-implicit-profiled.rkt | racket | An empty deque
Check for empty deque
Inserts an element into the front of deque
Inserts into the rear of the queue
Returns the last element of the deque
Returns a deque without the last element
Similar to build-list
tests
- because we are inserting from rear
suggests delaying ln67,col15 and ln66,col15 (main... | #lang s-exp "../../lazy-profile.rkt"
(struct Zero ())
(struct One (elem))
(struct Two (first second))
(struct Three (first second third))
( define - type ( D A ) ( U Zero ( One A ) ( Two A ) ( Three A ) ) )
( define - type ( D1 A ) ( U Zero ( One A ) ( Two A ) ) )
(struct Shallow (elem))
(struct Deep (F M R))
... |
d385ee0f46183009ea6e43e7b265fec96893f308b0ec3237999c08774bb56547 | deg/sodium | core_test.cljs | (ns sodium.core-test
(:require [cljs.test :refer-macros [deftest testing is are]]
[sodium.core :as na]))
| null | https://raw.githubusercontent.com/deg/sodium/1855fe870c3719af7d16d85c2558df1799a9bd32/test/sodium/core_test.cljs | clojure | (ns sodium.core-test
(:require [cljs.test :refer-macros [deftest testing is are]]
[sodium.core :as na]))
| |
2c26ad2177deaf7746594514be45fd675d726ffd5554dc08e6348a496fd5db25 | astrada/ocaml-extjs | window.ml | let () =
Ext.instance##require(
Js.array [|
Js.string "Ext.window.Window";
Js.string "Ext.tab.*";
Js.string "Ext.toolbar.Spacer";
Js.string "Ext.layout.container.Card";
Js.string "Ext.layout.container.Border";
|],
Js.undefined,
Js.undefined,
Js.undefined)
let () =
... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/examples/window/window/window.ml | ocaml | let () =
Ext.instance##require(
Js.array [|
Js.string "Ext.window.Window";
Js.string "Ext.tab.*";
Js.string "Ext.toolbar.Spacer";
Js.string "Ext.layout.container.Card";
Js.string "Ext.layout.container.Border";
|],
Js.undefined,
Js.undefined,
Js.undefined)
let () =
... | |
db4fefc371689e8c4eb904223ea231f8370655d4bf25a479b3fea7601c2c98b7 | metawilm/cl-python | habitat.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : ; : PY - AST - USER - READTABLE -*-
;;
This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
;; distribute and use this software as governed by the terms
of the Lisp Lesser GNU Public License
;; (),
;; known as the LL... | null | https://raw.githubusercontent.com/metawilm/cl-python/bce7f80b0c67d3c9f514556f2d14d098efecdde8/runtime/habitat.lisp | lisp | Syntax : COMMON - LISP ; Package : ; : PY - AST - USER - READTABLE -*-
distribute and use this software as governed by the terms
(),
known as the LLGPL.
Habitat: "Where the snakes live" | This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
of the Lisp Lesser GNU Public License
(in-package :clpython)
(in-syntax *user-readtable*)
(defclass habitat ()
((stdin :initform nil :initarg :stdin :accessor %habitat-stdin)
(stdout :initform ni... |
881338beb946c0ed78b04d55e1d2894ad3daf6a58fa882d32ff043ab1f8f6fdb | BramvanVeenschoten1/qtt | Termination.hs | module Termination where
import Data.Set
import Data.Map
import Data.List
import Data.Maybe
import Control.Monad
import Control.Applicative hiding (Const)
import qualified Core as C
import Core hiding (Inductive,Fixpoint)
import Elaborator
import Elab
import Utils
import Normalization
import Substituti... | null | https://raw.githubusercontent.com/BramvanVeenschoten1/qtt/ece216ac2e6126b25e0894e93bd146a838b084b3/lamcvii/Termination.hs | haskell |
nested function calls will be handled in getRecursiveCalls
a recursive occurrence and its number
an argument to the function and its number
a term smaller than an argument and the number of said argument
a variable that is neither recursive nor smaller
information on which debruijn indices are possibly r... | module Termination where
import Data.Set
import Data.Map
import Data.List
import Data.Maybe
import Control.Monad
import Control.Applicative hiding (Const)
import qualified Core as C
import Core hiding (Inductive,Fixpoint)
import Elaborator
import Elab
import Utils
import Normalization
import Substituti... |
5e5c403c2476406231cb612f395b7cee7bd4e59623cf3d8ab379de2bc4eb4315 | tisnik/clojure-examples | core.clj | ;
Druha varianta velmi jednoducheho IRC :
bot nyni odpovida na zpravy , ktere urceny
;
Autor :
;
(ns ircbot2.core
(:gen-class))
(require '[irclj.core :as irc])
(def configuration
"Datova struktura obsahujici informace o pripojeni na IRC server."
vsem dostupny IRC server
:port 6667 ... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/ircbot2/src/ircbot2/core.clj | clojure |
vychozi port
prima zprava
vlastni pripojeni na server | Druha varianta velmi jednoducheho IRC :
bot nyni odpovida na zpravy , ktere urceny
Autor :
(ns ircbot2.core
(:gen-class))
(require '[irclj.core :as irc])
(def configuration
"Datova struktura obsahujici informace o pripojeni na IRC server."
vsem dostupny IRC server
kanal , ktery je urceny pro te... |
dafda3a0892afe9e22df03aa3bc7f0154942b757dc8f0350b57e36c792693dff | bobatkey/CS316-2022 | Week02Intro.hs | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Week02Intro where
import Prelude hiding (Maybe, Nothing, Just)
Week 02 ; Lecture 03
MAKING DECISIONS and DEALING WITH FAILURE
MAKING DECISIONS and DEALING WITH FAILURE
-}
-- isMember; using if-then-else
isMember :: Eq a
=> a -... | null | https://raw.githubusercontent.com/bobatkey/CS316-2022/02bba64b6a5674201244c1cf8f5cda49df51100e/lecture-notes/Week02Intro.hs | haskell | isMember; using if-then-else
y :: a
x :: a
xs :: [a]
We can't repeat the 'y' twice in the pattern to stand for equality
isMember2; using guards
| x /= y = isMember2 y xs --- this by itself is not enough to guarantee completeness
case x - y of
0 -> True
1 -> True
_ -> isMember y xs
Trees
... | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Week02Intro where
import Prelude hiding (Maybe, Nothing, Just)
Week 02 ; Lecture 03
MAKING DECISIONS and DEALING WITH FAILURE
MAKING DECISIONS and DEALING WITH FAILURE
-}
isMember :: Eq a
=> a -> [a] -> Bool
isMember y [] ... |
dc58dc898e3907c5d225c5eddd2a92d515b17bea30e92c2b1c9692e6a50c796b | alakahakai/hackerrank | lists-and-gcd.hs | {-
List and gcd
-and-gcd
-}
import Control.Applicative ((<$>))
import Control.Monad (forM)
import Data.Maybe
newtype Power = Power (Int, Int)
deriving Show
readNumbers :: String -> [Power]
readNumbers s = go [] (map (\x -> read x :: Int) $ words s) where
go ps [] = ps
go... | null | https://raw.githubusercontent.com/alakahakai/hackerrank/465d17107bbe402daf750651bb57cf092305acf9/fp/lists-and-gcd.hs | haskell |
List and gcd
-and-gcd
|
import Control.Applicative ((<$>))
import Control.Monad (forM)
import Data.Maybe
newtype Power = Power (Int, Int)
deriving Show
readNumbers :: String -> [Power]
readNumbers s = go [] (map (\x -> read x :: Int) $ words s) where
go ps [] = ps
go ps (x:y:ys) = go (Power (x,y) :... |
ca9dea1ae84c75dcf9b3afb41edce8a74eeff394daf5fe33557c857b78559e49 | ghc/testsuite | tcrun008.hs | {-# LANGUAGE Rank2Types #-}
-- !!! Check that record selectors for polymorphic fields work right
module Main where
class Foo a where
bar :: a -> [a]
instance Foo Int where
bar x = replicate x x
instance Foo Bool where
bar x = [x, not x]
data Record = R {
blub :: Foo a => a -> [a]
}
main = do { let... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_run/tcrun008.hs | haskell | # LANGUAGE Rank2Types #
!!! Check that record selectors for polymorphic fields work right |
module Main where
class Foo a where
bar :: a -> [a]
instance Foo Int where
bar x = replicate x x
instance Foo Bool where
bar x = [x, not x]
data Record = R {
blub :: Foo a => a -> [a]
}
main = do { let r = R {blub = bar}
; print (blub r (3::Int))
; print (blub r True)
}
|
6a5dc207941e810da841517eadebc11887782c382b4b46ab38d9397060904271 | helvm/helma | IntCellType.hs | module HelVM.HelMA.Automaton.Types.IntCellType where
import HelVM.HelIO.SwitchEnum
-- | Constructors
defaultIntCellType :: IntCellType
defaultIntCellType = defaultEnum
intCellTypes :: [IntCellType]
intCellTypes = generateEnums 5
-- | Types
data IntCellType = IntegerType | Int8Type | Int16Type | Int32Type ... | null | https://raw.githubusercontent.com/helvm/helma/a843fb86f4f51c84fd8c65970d0fb0221d551218/hs/src/HelVM/HelMA/Automaton/Types/IntCellType.hs | haskell | | Constructors
| Types | module HelVM.HelMA.Automaton.Types.IntCellType where
import HelVM.HelIO.SwitchEnum
defaultIntCellType :: IntCellType
defaultIntCellType = defaultEnum
intCellTypes :: [IntCellType]
intCellTypes = generateEnums 5
data IntCellType = IntegerType | Int8Type | Int16Type | Int32Type | Int64Type
deriving stock... |
c9de280845519eaf877cdc4272e49410689709a5d99e2d81c997e95304320a22 | UU-ComputerScience/uhc | data-field5.hs | -- data fields construction: duplicate field
% % inline test ( ) --
data X
= X { b :: Int, a, c :: Char }
x1 = X { c = 'y', a = 'x', b = 4, b = 5 }
main = c x1
| null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/7/data-field5.hs | haskell | data fields construction: duplicate field
|
data X
= X { b :: Int, a, c :: Char }
x1 = X { c = 'y', a = 'x', b = 4, b = 5 }
main = c x1
|
da9684374466f03fbde848c0c65b80bccdf43d5b43779f6f458037a3d16292dc | Vigilans/hscc | Semantic.hs | module Language.C.Semantic (module Semantic) where
import Language.C.Semantic.Analysis as Semantic
import Language.C.Semantic.Evaluate as Semantic
import Language.C.Semantic.Validate as Semantic
| null | https://raw.githubusercontent.com/Vigilans/hscc/d612c54f9263d90fb01673aea1820a62fdf62551/src/Language/C/Semantic.hs | haskell | module Language.C.Semantic (module Semantic) where
import Language.C.Semantic.Analysis as Semantic
import Language.C.Semantic.Evaluate as Semantic
import Language.C.Semantic.Validate as Semantic
| |
45b17cd5c32c93e91f7613e2580096fd5f2a0116f2894442a07de0451d633fdd | kadena-io/chainweb-node | Trace.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
-- |
-- Module: Utils.Logging.Trace
Copyright : Copyright © 2018 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
-- Stabil... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/62e5eeccd1ae4a5e4ca56452f7c85d07cdb483c4/src/Utils/Logging/Trace.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
|
Module: Utils.Logging.Trace
Stability: experimental
Tools for tracing and logging the runtime of functions.
This should be used with care, since it adds overhead to the system. /It is
runtime for profi... | # LANGUAGE DeriveGeneric #
# LANGUAGE ScopedTypeVariables #
Copyright : Copyright © 2018 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
not meant to replace a profiling/. There is a reason why GHC uses a dedicated
module Utils.Logging.Trace
( trace
, Trace
) where
import Control.DeepSeq
import Control.... |
54271bfd43422989b91bcbf640bde1a335884e71c02eefa7155be54bf7134600 | SjVer/Som-Lang | context.ml | open Parse.Ast
module IMap = Symboltable.IMap
(* ast symbol table stuff *)
type ast_symbol_table = (value_definition, type_definition) Symboltable.t
let print_ast_table (table : ast_symbol_table) =
let fmt i w n = "("^string_of_int i^") <def "^w^" "^n^">" in
let open Symboltable in
let valuefn {index = i; symb... | null | https://raw.githubusercontent.com/SjVer/Som-Lang/c4a606c745d04746cdbf839dddd2603738d217e4/somc/lib/analysis/context.ml | ocaml | ast symbol table stuff
context stuff
path of module
present submodules
maps of local to qualified identifiers
table with qualified identifiers
initializers
finding
adding
let add_subcontext ctx ident =
{ctx with subcontexts = ctx.subcontexts @ [ident]}
ugly shit
only changes the bindings
{
... | open Parse.Ast
module IMap = Symboltable.IMap
type ast_symbol_table = (value_definition, type_definition) Symboltable.t
let print_ast_table (table : ast_symbol_table) =
let fmt i w n = "("^string_of_int i^") <def "^w^" "^n^">" in
let open Symboltable in
let valuefn {index = i; symbol = s; uses = _} =
Parse... |
3bfb0e2858dd4265a89af37e0af06575e5afb4896d366d960fc235ec4ef878c6 | dstcruz/Write-Yourself-A-Scheme-In-48-Hours | listing2.hs | module Main where
import System.Environment
import Text.ParserCombinators.Parsec hiding (spaces)
main :: IO ()
main = do
args <- getArgs
putStrLn (readExpr (args !! 0))
symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
readExpr :: String -> String
readExpr input = case parse symbol "lisp" input of... | null | https://raw.githubusercontent.com/dstcruz/Write-Yourself-A-Scheme-In-48-Hours/19765a03fb01d788066259d115c7798518224ad9/ch02/parsing/listing2.hs | haskell | module Main where
import System.Environment
import Text.ParserCombinators.Parsec hiding (spaces)
main :: IO ()
main = do
args <- getArgs
putStrLn (readExpr (args !! 0))
symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
readExpr :: String -> String
readExpr input = case parse symbol "lisp" input of... | |
e8af8fb15cbea763b2b87485cb83e0c2040dcc9394c3d3883cdb6d1fbc7a1b03 | chef/chef-server | chef_solr_tests.erl | Copyright Chef Software , Inc. All Rights Reserved .
%%
This file is provided to you 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 agr... | null | https://raw.githubusercontent.com/chef/chef-server/6d31841ecd73d984d819244add7ad6ebac284323/src/oc_erchef/apps/chef_index/test/chef_solr_tests.erl | erlang |
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
note the missing org filter | Copyright Chef Software , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(chef_solr_tests).... |
7503fb74d6f01fcce7b01965ef40ab01a42098b6432afc5390fd007bf7a719fb | atgreen/red-light-green-light | tests.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN - TESTS ; -*-
(in-package :postmodern-tests)
;; Adjust the above to some db/user/pass/host combination that refers
;; to a valid postgresql database in which no table named test_data
;; currently exists. Then after loading the file, r... | null | https://raw.githubusercontent.com/atgreen/red-light-green-light/f067507721bbab4aa973866db5276c83df3e8784/local-projects/postmodern-20220220-git/postmodern/tests/tests.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN - TESTS ; -*-
Adjust the above to some db/user/pass/host combination that refers
to a valid postgresql database in which no table named test_data
currently exists. Then after loading the file, run the tests with
(run! :postmodern)
Reset readtable to... | (in-package :postmodern-tests)
(def-suite :postmodern
:description "Test suite for postmodern subdirectory files")
(def-suite :postmodern-base
:description "Base Test suite for postmodern subdirectory files")
(in-suite :postmodern-base)
(def-suite :postmodern-base
:description "Base test suite for postmode... |
0150176fba0c70b00103f13d29dbf85b8c4b75c075c5d2edea00b7f51774b641 | tomjridge/mini-btree | btree_impl_intf.ml | (** Main implementation types *)
type constants = {
max_leaf_keys : int;
max_branch_keys : int;
}
(** Calculate constants given blk size and k and v size. NOTE assumes type r = int *)
let make_constants ~blk_sz ~k_sz ~v_sz =
let bytes_per_int = 10 in (* over estimate *)
let r_sz = bytes_per_int in
NOTE s... | null | https://raw.githubusercontent.com/tomjridge/mini-btree/63085e877adf9d27d9ebc82a87914f9f1686f55d/src/btree_impl_intf.ml | ocaml | * Main implementation types
* Calculate constants given blk size and k and v size. NOTE assumes type r = int
over estimate
* NOTE Leaves are mutable
first leaf has n keys
* NOTE Nodes are mutable
* Types used for exporting/importing only
* What we need to construct the B-tree
* What we get after constructing ... |
type constants = {
max_leaf_keys : int;
max_branch_keys : int;
}
let make_constants ~blk_sz ~k_sz ~v_sz =
let r_sz = bytes_per_int in
NOTE subtract bytes_per_int for the tag
let constants = {
FIXME why 2 * ( .. ) ?
max_branch_keys = (blk_sz - bytes_per_int)/(k_sz+r_sz)
}
in
constants
type ... |
48dff044c31d577146e9b126af1cbae5ebf969e784891e8b99859fba3ab8ea04 | S8A/htdp-exercises | ex172.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex172) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex172.rkt | racket | about the language level of this file in a form that our tools can easily process.
- '()
- (cons String LS)
- '()
LLS -> String
converts a list of lines into a string, words separated by blank spaces
and lines separated by newlines.
List-of-strings -> String
converts a line into a string, words separated by bl... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex172) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t ... |
5552f816dff877ca6edda4e37bf12ec10b0c5f2da763e05b9c59b2971aaf523f | tmcgilchrist/ocaml-gitlab | types.mli | type binding = string * string (* Key/value pair *)
type section = string * binding list (* Section name and contents *)
type config = section list
| null | https://raw.githubusercontent.com/tmcgilchrist/ocaml-gitlab/de4d1cc31d172e599943fe712269f165f1c88909/cli/gitconfig/types.mli | ocaml | Key/value pair
Section name and contents | type config = section list
|
d172feabb42760d62e78cd0dbf9b6550122cb58c28371b4760315b6903822e00 | nomeata/haskell-via-sokoban | 03-list-fun.hs | {-# LANGUAGE OverloadedStrings #-}
import CodeWorld
wall, ground, storage, box :: Picture
wall = colored grey (solidRectangle 1 1)
ground = colored yellow (solidRectangle 1 1)
storage = colored white (solidCircle 0.3) & ground
box = colored brown (solidRectangle 1 1)
data Tile = Wall | Ground | Storage | B... | null | https://raw.githubusercontent.com/nomeata/haskell-via-sokoban/0ae9d6e120c2851eca158c01e08e2c4c7f2b06d0/code/03-list-fun.hs | haskell | # LANGUAGE OverloadedStrings #
Cunning! | import CodeWorld
wall, ground, storage, box :: Picture
wall = colored grey (solidRectangle 1 1)
ground = colored yellow (solidRectangle 1 1)
storage = colored white (solidCircle 0.3) & ground
box = colored brown (solidRectangle 1 1)
data Tile = Wall | Ground | Storage | Box | Blank
drawTile :: Tile -> Pic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.