_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 |
|---|---|---|---|---|---|---|---|---|
4cbb145330e7c1e3131514b53357a968bea98edeaef6012d3ddbf7c6cd88133f | lsevero/abclj | core.clj | (ns game-of-life.core
(:import game_of_life.LifeGUI
java.awt.Dimension
java.awt.event.WindowAdapter
javax.swing.JFrame))
(defn -main []
(let [applet-width 1024
frame (JFrame. "Conway's Game of Life")
life-gui (game_of_life.LifeGUI.)]
(doto frame
(.addWindo... | null | https://raw.githubusercontent.com/lsevero/abclj/9f5a10aa98789a94f550b13d07e57b4fcefccfab/examples/game-of-life/src/game_of_life/core.clj | clojure | (ns game-of-life.core
(:import game_of_life.LifeGUI
java.awt.Dimension
java.awt.event.WindowAdapter
javax.swing.JFrame))
(defn -main []
(let [applet-width 1024
frame (JFrame. "Conway's Game of Life")
life-gui (game_of_life.LifeGUI.)]
(doto frame
(.addWindo... | |
6805ef80642e517d92b28c89597dea242dcd503c797746fc8bed51c856bef943 | racket/compatibility | mlist.rkt | #lang racket/base
(require (for-syntax racket/base)
racket/performance-hint)
(provide mmap
mfor-each
mlist
mlist?
mlength
mappend
mappend!
mreverse
mreverse!
mlist-tail
mlist-ref
mmemq
mmemv
m... | null | https://raw.githubusercontent.com/racket/compatibility/492030dac6f095045ce8a13dca75204dd5f34e32/compatibility-lib/compatibility/mlist.rkt | racket | mappend! : like append, but mutate each list to refer to the next. | #lang racket/base
(require (for-syntax racket/base)
racket/performance-hint)
(provide mmap
mfor-each
mlist
mlist?
mlength
mappend
mappend!
mreverse
mreverse!
mlist-tail
mlist-ref
mmemq
mmemv
m... |
eeee972aa4d2febcbbd1bc47e04631e1101526b44594504b8ccdc59a83dba4ed | leo-project/leo_gateway | leo_gateway_app.erl | %%======================================================================
%%
Leo Gateway
%%
Copyright ( c ) 2012 - 2015 Rakuten , Inc.
%%
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... | null | https://raw.githubusercontent.com/leo-project/leo_gateway/7bac8912b762688f0ef237b31fee17e30e3888a3/src/leo_gateway_app.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 permis... | Leo Gateway
Copyright ( c ) 2012 - 2015 Rakuten , Inc.
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
Leo Gateway - Applic... |
f1cecd41c47970118593c1f1f12d8b57af48185b8cd7bda58a8e90d4bb6d2684 | mishun/tangles | ModifyDSL.hs | # LANGUAGE FlexibleContexts , TypeFamilies , RankNTypes #
module Math.Topology.KnotTh.Moves.ModifyDSL
( ModifyDSL(..)
, greedy
) where
import Control.Monad (when)
import Math.Topology.KnotTh.Knotted
import Math.Topology.KnotTh.Knotted.Crossings.Diagram
class (Knotted k) => ModifyDSL k where
data Modi... | null | https://raw.githubusercontent.com/mishun/tangles/9af39dd48e3dcc5e3944f8d060c8769ff3d81d02/src/Math/Topology/KnotTh/Moves/ModifyDSL.hs | haskell | # LANGUAGE FlexibleContexts , TypeFamilies , RankNTypes #
module Math.Topology.KnotTh.Moves.ModifyDSL
( ModifyDSL(..)
, greedy
) where
import Control.Monad (when)
import Math.Topology.KnotTh.Knotted
import Math.Topology.KnotTh.Knotted.Crossings.Diagram
class (Knotted k) => ModifyDSL k where
data Modi... | |
bd20185f9708d710fee7da827dc8192536d5d808ed518155c49e80f2e08ddfa5 | cachix/elm2nix | PackagesSnapshot.hs | Downloads binary serialized -lang.org/all-packages
as Elm compiler expects it to parse .
Takes Elm upstream code from :
-
-
-
as Elm compiler expects it to parse.
Takes Elm upstream code from:
-
-
-
-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE CPP #
{-# LANGUAGE BangPat... | null | https://raw.githubusercontent.com/cachix/elm2nix/e4df54baf154d6474553cc2af9f31c353bb37f53/src/Elm2Nix/PackagesSnapshot.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE BangPatterns #
# UNPACK #
# UNPACK #
# UNPACK # | Downloads binary serialized -lang.org/all-packages
as Elm compiler expects it to parse .
Takes Elm upstream code from :
-
-
-
as Elm compiler expects it to parse.
Takes Elm upstream code from:
-
-
-
-}
# LANGUAGE CPP #
module Elm2Nix.PackagesSnapshot
( snapshot
) where
... |
5fbf1165e9467ff8a88d82582c98cf58b36db29ba6fd780aa6bcd45c690c089f | sfu-natlang/yarowsky | hsgraph.ml |
Program for the algorithm ( Yarowsky 1995 ) as described in Collins & Singer 1999 .
Program for the Yarowsky algorithm (Yarowsky 1995) as described in Collins & Singer 1999.
*)
open Utils
let majority labels dists =
let uniform = 1.0 /. float_of_int (List.length labels) in
let votes = setup (Data.Label.Table... | null | https://raw.githubusercontent.com/sfu-natlang/yarowsky/2c73d702909b4d3844b31a60947edfe72ab156b7/programs/hsgraph.ml | ocaml |
Program for the algorithm ( Yarowsky 1995 ) as described in Collins & Singer 1999 .
Program for the Yarowsky algorithm (Yarowsky 1995) as described in Collins & Singer 1999.
*)
open Utils
let majority labels dists =
let uniform = 1.0 /. float_of_int (List.length labels) in
let votes = setup (Data.Label.Table... | |
60b5f867637b8c9698edc2ef395337e6268d15700647eb6e29804300beadca53 | p2k/ecoinpool | ebitcoin_test_launch.erl |
%%
Copyright ( C ) 2011 Patrick " p2k " < >
%%
This file is part of ebitcoin .
%%
%% ebitcoin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
%% (at your option) ... | null | https://raw.githubusercontent.com/p2k/ecoinpool/01ba76a7ab4b17b60cb0c525786fddef43ea80e1/apps/ebitcoin/src/ebitcoin_test_launch.erl | erlang |
ebitcoin is free software: you can redistribute it and/or modify
(at your option) any later version.
ebitcoin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public Licen... |
Copyright ( C ) 2011 Patrick " p2k " < >
This file is part of ebitcoin .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
along with ebitcoin . If ... |
e0629a170eefc26919f17aae90ee5ac13c2c01e416bed50309bd7402e36a5c2b | realworldocaml/mdx | deprecated.mli |
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/realworldocaml/mdx/6a7c12ecfee63122363fb425aada278b2c282b8d/lib/deprecated.mli | ocaml | * Emits a warning on the standard error. |
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
b8046c5e6de4cacc396d830954734d0e378497a930eb39931666e93083489f8f | BoeingX/haskell-programming-from-first-principles | ExerciseSpec.hs | module Monad.Monad.ExerciseSpec where
import Test.Hspec
import Monad.Monad.Exercise
spec :: Spec
spec = do
describe "Test bind" $ do
it "bind" $ do
let f n
| n >= 0 = Just n
| otherwise = Nothing
bind f (Just 1) `shouldBe` Just 1
... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/test/Monad/Monad/ExerciseSpec.hs | haskell | module Monad.Monad.ExerciseSpec where
import Test.Hspec
import Monad.Monad.Exercise
spec :: Spec
spec = do
describe "Test bind" $ do
it "bind" $ do
let f n
| n >= 0 = Just n
| otherwise = Nothing
bind f (Just 1) `shouldBe` Just 1
... | |
c2842bb0725c0533e753328692fae8fe2fcfad23bbc51c8f724c56a066fb7cf9 | oakes/play-cljc-examples | dev.clj | (defmulti task first)
(defmethod task :default
[[task-name]]
(println "Unknown task:" task-name)
(System/exit 1))
(require '[figwheel.main :as figwheel])
(defmethod task nil
[_]
(figwheel/-main "--build" "dev"))
(defmethod task "native"
[_]
(require '[basic-bird.start-dev])
((resolve 'basic-bird.sta... | null | https://raw.githubusercontent.com/oakes/play-cljc-examples/4e90d4de09b4d32c31412a3204c5a15f012f8060/basic-bird/dev.clj | clojure | (defmulti task first)
(defmethod task :default
[[task-name]]
(println "Unknown task:" task-name)
(System/exit 1))
(require '[figwheel.main :as figwheel])
(defmethod task nil
[_]
(figwheel/-main "--build" "dev"))
(defmethod task "native"
[_]
(require '[basic-bird.start-dev])
((resolve 'basic-bird.sta... | |
bafac4a5b80907c16c7f98aa30e200edbb845ce03c41e8ccaa1b8533306ff51f | TomerAberbach/programming-in-haskell-exercises | 3.hs | n = a `div` length xs
where
a = 10
xs = [1, 2, 3, 4, 5]
| null | https://raw.githubusercontent.com/TomerAberbach/programming-in-haskell-exercises/a66830529ebc9c4d84d0e4c6e0ad58041b46bc32/parts/1/chapters/2/3.hs | haskell | n = a `div` length xs
where
a = 10
xs = [1, 2, 3, 4, 5]
| |
83109ba8b28532c6cd7ab1615cd072fc94a44872eb66c750f038af65681821f2 | ghc/packages-base | Types.hs | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , ExistentialQuantification #
{-# OPTIONS_GHC -funbox-strict-fields #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.IO.Encoding.Types
Copyright : ( c ) The University of Glasgow , 2008 - 2009
-- Li... | null | https://raw.githubusercontent.com/ghc/packages-base/52c0b09036c36f1ed928663abb2f295fd36a88bb/GHC/IO/Encoding/Types.hs | haskell | # OPTIONS_GHC -funbox-strict-fields #
---------------------------------------------------------------------------
|
Module : GHC.IO.Encoding.Types
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
Portability : non-portable
Types for text encoding/decoding
-------------... | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , ExistentialQuantification #
Copyright : ( c ) The University of Glasgow , 2008 - 2009
module GHC.IO.Encoding.Types (
BufferCodec(..),
TextEncoding(..),
TextEncoder, TextDecoder,
CodeBuffer, EncodeBuffer, DecodeBuffer,
CodingProgress(..... |
81a9a1d6634cd0c6510e86d4daa4486bbf58b4d324411d057c1c76c121ec4411 | freizl/dive-into-haskell | IdentityT.hs | -- |
module IdentityT where
newtype IdentityT m a = IdentityT {runIdentityT :: m a} deriving (Eq, Show)
instance Functor m => Functor (IdentityT m) where
-- fmap :: (a -> b) -> f a -> f b
fmap f (IdentityT ma) = IdentityT (f <$> ma)
instance Applicative m => Applicative (IdentityT m) where
pure = IdentityT . p... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/25/IdentityT.hs | haskell | |
fmap :: (a -> b) -> f a -> f b
(>>=) :: m a -> (a -> m b) -> m b
simplified to: IdentityT (ma >>= runIdentityT . f) | module IdentityT where
newtype IdentityT m a = IdentityT {runIdentityT :: m a} deriving (Eq, Show)
instance Functor m => Functor (IdentityT m) where
fmap f (IdentityT ma) = IdentityT (f <$> ma)
instance Applicative m => Applicative (IdentityT m) where
pure = IdentityT . pure
(IdentityT mf) <*> (IdentityT ma) =... |
5344be24e5cfd12ad01f174502b9e1686b9f0ca3cda2a98d1b6840ea28cf0961 | marigold-dev/deku | external_process.ml | (** Interface between a long lived Go process and an OCaml consumer *)
(* TODO: some code is duplicated from tezos_interop/long_lived_js_process.ml *)
exception Process_closed of Unix.process_status
exception Failed_to_parse_json of string * Data_encoding.Json.t
(* enhance error messages *)
let () =
let open Forma... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/external_vm/external_process.ml | ocaml | * Interface between a long lived Go process and an OCaml consumer
TODO: some code is duplicated from tezos_interop/long_lived_js_process.ml
enhance error messages
intentional, any exception in this file should kill the node
FIXME: what to do if this fails? |
exception Process_closed of Unix.process_status
exception Failed_to_parse_json of string * Data_encoding.Json.t
let () =
let open Format in
let pp_process_status fmt status =
match status with
| Unix.WEXITED content -> fprintf fmt "WEXITED %d" content
| Unix.WSIGNALED content -> fprintf fmt "WSIGNALE... |
886f04fff33fef599049c14da993e7de301ac12f4b8c87bf1acfdba04b37cd5e | PLSysSec/lio | Auth.hs | # LANGUAGE Trustworthy #
{-# LANGUAGE OverloadedStrings #-}
-- | Provides generic and HTTP Basic authentication.
module LIO.Web.Simple.Auth ( basicAuth
, handleAuth
, requestLogin
-- * Helpers
, withUserOrLogin
... | null | https://raw.githubusercontent.com/PLSysSec/lio/622a3e7bc86a3b42ab4ce8be954064a5f142247a/lio-simple/LIO/Web/Simple/Auth.hs | haskell | # LANGUAGE OverloadedStrings #
| Provides generic and HTTP Basic authentication.
* Helpers
| A middleware that uses HTTP basic authentication to authenticate
a request for a realm with the given username and password. The
request is rewritten with an @X-User@ request header containing the
authenticated username b... | # LANGUAGE Trustworthy #
module LIO.Web.Simple.Auth ( basicAuth
, handleAuth
, requestLogin
, withUserOrLogin
, currentUser
) where
import Data.Maybe
import Control.Monad
import quali... |
148ae87dfcabb7981dfe193c610b6b74726adcc2eecaad5e5f50ab553eff5300 | jimburton/scrabble | Main.hs | {-# Language OverloadedStrings #-}
module Main where
import Data.Aeson (decode)
import Control.Concurrent (forkIO, threadDelay)
import qualified Network.WebSockets as WS
import Control.Concurrent.BoundedChan
import qualified Data.Text as T
import qualified Data.ByteString.Lazy.Char8 as B
import System.Log.Logger
impo... | null | https://raw.githubusercontent.com/jimburton/scrabble/b43e247c23357db8e53354e4dbffd377efb3d93d/web/server/Main.hs | haskell | # Language OverloadedStrings #
=========== Entry point for the web server ========= --
| Command-line options for the server
| Makes incoming connections into Clients and adds them to the queue.
keep the connection alive by having a thread that listens to it
| Entry point for the server. It begins by reading the c... | module Main where
import Data.Aeson (decode)
import Control.Concurrent (forkIO, threadDelay)
import qualified Network.WebSockets as WS
import Control.Concurrent.BoundedChan
import qualified Data.Text as T
import qualified Data.ByteString.Lazy.Char8 as B
import System.Log.Logger
import System.Log.Handler.Simple
import... |
f5bfdec89274051574d21e27ba896e1e2345b60e723874dd3364de9fa02b43fe | ocaml-sf/learn-ocaml-corpus | choose_right.ml | let return (x : 'a) : 'a m =
Seq.singleton x
let (>>=) (m1 : 'a m) (f2 : 'a -> 'b m) : 'b m =
m1 |> Seq.map f2 |> Seq.flatten
let fail : 'a m =
Seq.nil
let choose (m1 : 'a m) (m2 : 'a m) : 'a m =
m2 (* wrong *)
let sols (m : 'a m) : 'a Seq.t =
m
| null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/nondet_monad_seq/wrong/choose_right.ml | ocaml | wrong | let return (x : 'a) : 'a m =
Seq.singleton x
let (>>=) (m1 : 'a m) (f2 : 'a -> 'b m) : 'b m =
m1 |> Seq.map f2 |> Seq.flatten
let fail : 'a m =
Seq.nil
let choose (m1 : 'a m) (m2 : 'a m) : 'a m =
let sols (m : 'a m) : 'a Seq.t =
m
|
ecf4f63026fe98beb9f6f1ecb382773f24e69a1ceb2d747fda117b83f1560f64 | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-logging/gen/Gogol/Logging/Folders/Locations/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Lists information about the supported locations for this service.
/See:/ </ Cloud Logging API Reference> for @logging.folders.locations.list@.
* Resource
** Constructing a Request
| A resource alias for @logging.folders.locat... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
357c574e013ef4ff90befdcf09c27fdfb743d132fb1af3bfca573f5bd182cb46 | lichtblau/CommonQt | t6.lisp | ;;; -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
;;; -t6.html
(defpackage :qt-tutorial-6
(:use :cl :qt)
(:export #:main))
(in-package :qt-tutorial-6)
(named-readtables:in-readtable :qt)
(defvar *qapp*)
(defclass lcd-range ()
()
(:metaclass qt-class)
(:qt-superclass "QWidget"))
(defmethod... | null | https://raw.githubusercontent.com/lichtblau/CommonQt/fa14472594b2b2b34695ec3fff6f858a03ec5813/tutorial/old/t6.lisp | lisp | -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
-t6.html |
(defpackage :qt-tutorial-6
(:use :cl :qt)
(:export #:main))
(in-package :qt-tutorial-6)
(named-readtables:in-readtable :qt)
(defvar *qapp*)
(defclass lcd-range ()
()
(:metaclass qt-class)
(:qt-superclass "QWidget"))
(defmethod initialize-instance :after ((instance lcd-range) &key parent)
(if parent
... |
dbaade52fbebb4d75b05a497b7dd8f33a570b285c332706317449e586cfe461a | music-suite/music-suite | Reactive.hs | # OPTIONS_GHC -fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-redundant-constraints #-}
module Music.Time.Reactive
( -- * Reactive type
Reactive,
-- * Query
initial,
final,
intermediate,
discrete,
updates,
occs,
atTime,
-- * Constructio... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Music/Time/Reactive.hs | haskell | * Reactive type
* Query
* Construction
* Combine
* Split
* Sampling
|
Forms an applicative as per 'Behavior', but only switches at discrete points.
|
Get the initial value.
It looks strange but it works
| Get the time of all updates and the value switched to at this point.
| Get the time of all updates.
l... | # OPTIONS_GHC -fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-redundant-constraints #-}
module Music.Time.Reactive
Reactive,
initial,
final,
intermediate,
discrete,
updates,
occs,
atTime,
switchR,
trimR,
splitReactive,
Segment,... |
b08c932d5f9b72ad6d6d6a5a6715c698d8c083052b556272dc37208b60dd88b3 | ltoth/unison | osx.ml | Unison file synchronizer : src / osx.ml
Copyright 1999 - 2010 ,
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ... | null | https://raw.githubusercontent.com/ltoth/unison/e763510165e3d93c5140a4c5f2ea0dcbf5825a0c/osx.ml | ocaml |
See
-42/copyfile.c
**
**
Defining this variable as a preference ensures that it will be propagated
to the other host during initialization
**
pad
magic
debug tag
total size
data_length
reserved
flags
num_attrs
**
Ignore hasBeenInited flag
If the extended flags should be ignored, clear them
N... | Unison file synchronizer : src / osx.ml
Copyright 1999 - 2010 ,
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ... |
26e51a6e0529a4385f7f1937462adfb85cb0bdbc66d034dcfa0d18405b0d7ff0 | karttu/bream | simpleio.brm.scm |
;;
(-MODULE-INFO-BEGIN-)
;;
;; simpleio.brm.scm - Very simple I/O routines for the initial version
;; of Bream. Currently just a couple of output routines
that use a separate outbyte115200_1_1_8.v Verilog - module
which sends a byte to UART with the speed 11... | null | https://raw.githubusercontent.com/karttu/bream/f46f2da3b285d70e83d9ae167a9d2f57f157236c/src/breamlib/simpleio.brm.scm | scheme |
simpleio.brm.scm - Very simple I/O routines for the initial version
of Bream. Currently just a couple of output routines
CHANGES
Removed all functions and macros that were intended solely for
Added "unbuffered" versions of outchars11 and outchars12.
Output n 8-bit bytes given in ... |
(-MODULE-INFO-BEGIN-)
that use a separate outbyte115200_1_1_8.v Verilog - module
which sends a byte to UART with the speed 115200 bps .
Copyright ( C ) 2010 - 2011 , and subject to LGPL v2
(-MODULE-INFO-END-)
Edited Aug 29 2011 by karttu .
the MIT / GNU Scheme - ... |
0bf4de2046643a8dfbeae3b965804f124883844ced75b2ed3e39954cc515757c | manuel-serrano/bigloo | speek.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / bdb / bdb / Tools / speek.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/bdb/bdb/Tools/speek.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / bdb / bdb / Tools / speek.scm * /
* Author : * /
* Creation : Tue Jul 27 07:22:58 1999 * /
* Last change : We d Aug 9 08:02:44 2000 ( serrano ) * /
* ... |
65f7165ee15f9d12e4a62fe1f032d41da28f6f4e4f27386f0e6eee1d45c3e5d9 | alanz/ghc-exactprint | Dead1.hs | {-# OPTIONS -O -ddump-stranal #-}
module Dead1(foo) where
foo :: Int -> Int
foo n = baz (n+1) (bar1 n)
# NOINLINE bar1 #
bar1 n = 1 + bar n
bar :: Int -> Int
# NOINLINE bar #
{-# RULES
"bar/foo" forall n. bar (foo n) = n
#-}
bar n = n-1
baz :: Int -> Int -> Int
{-# INLINE [0] baz #-}
baz m n = m
Ronam writ... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/Dead1.hs | haskell | # OPTIONS -O -ddump-stranal #
# RULES
"bar/foo" forall n. bar (foo n) = n
#
# INLINE [0] baz # |
module Dead1(foo) where
foo :: Int -> Int
foo n = baz (n+1) (bar1 n)
# NOINLINE bar1 #
bar1 n = 1 + bar n
bar :: Int -> Int
# NOINLINE bar #
bar n = n-1
baz :: Int -> Int -> Int
baz m n = m
Ronam writes ( )
Note that bar becomes dead as soon as baz gets inlined . But strangely ,
the simplifier on... |
78efed7bcb88c418be38f0675a821ca7b42079bb80a136850492738948af6de4 | haskell-compat/base-compat | Compat.hs | # LANGUAGE CPP , NoImplicitPrelude #
module Control.Monad.ST.Lazy.Unsafe.Compat (
-- * Unsafe operations
unsafeInterleaveST
, unsafeIOToST
) where
#if MIN_VERSION_base(4,6,0)
import Control.Monad.ST.Lazy.Unsafe (unsafeInterleaveST, unsafeIOToST)
#else
import Control.Monad.ST.Lazy (unsafeInterleaveST, unsafeIOToST)... | null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat/src/Control/Monad/ST/Lazy/Unsafe/Compat.hs | haskell | * Unsafe operations | # LANGUAGE CPP , NoImplicitPrelude #
module Control.Monad.ST.Lazy.Unsafe.Compat (
unsafeInterleaveST
, unsafeIOToST
) where
#if MIN_VERSION_base(4,6,0)
import Control.Monad.ST.Lazy.Unsafe (unsafeInterleaveST, unsafeIOToST)
#else
import Control.Monad.ST.Lazy (unsafeInterleaveST, unsafeIOToST)
#endif
|
dac7df5e97b16fbf4111a3aa73dad04dc4cfb29b9a2ef6657a83d834f927374c | MassD/mongo | mongoSend_lwt.ml | open MongoUtils;;
let send_no_reply_ (_,out_ch) request_str =
lwt _ = Lwt_io.write out_ch request_str in
Lwt_io.flush out_ch;;
let send_no_reply channel_pool request_str =
Lwt_pool.use channel_pool (
fun c -> send_no_reply_ c request_str
)
(* read complete reply portion, include complete message header *... | null | https://raw.githubusercontent.com/MassD/mongo/054779d843a227d486b55dff6ebc915b44906b0d/lwt/mongoSend_lwt.ml | ocaml | read complete reply portion, include complete message header
print_endline (Int32.to_string len32); | open MongoUtils;;
let send_no_reply_ (_,out_ch) request_str =
lwt _ = Lwt_io.write out_ch request_str in
Lwt_io.flush out_ch;;
let send_no_reply channel_pool request_str =
Lwt_pool.use channel_pool (
fun c -> send_no_reply_ c request_str
)
let read_reply (in_ch,_) =
let chr0 = Char.chr 0 in
let len_s... |
84aa30bb98945ff5f456a7fcd918baead11cf060cafb33a39a618d6f309fd40a | LexiFi/dead_code_analyzer | match-opt.ml | let f ?a ?b c = c
let m ?b = function
_::_ as l ->
let () = f ~a:1 ?b 0 |> ignore in [f ~a:1 ?b 0]
| [] -> [f ~a:1 0]
let l = m []
| null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/examples/dir/match-opt.ml | ocaml | let f ?a ?b c = c
let m ?b = function
_::_ as l ->
let () = f ~a:1 ?b 0 |> ignore in [f ~a:1 ?b 0]
| [] -> [f ~a:1 0]
let l = m []
| |
570b82b631bf361ffc00c17d27d1cd75557428df93682ddaaed1ee34e4fde03d | mlang/chessIO | Polyglot.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Game.Chess
import Game.Chess.Polyglot
import Test.HUnit
tests = test
[ "t1" ~: "start position" ~: hashPosition startpos ~=? 0x463b96181691fc9c
, "t2" ~: "after e4" ~: hashPosition "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQK... | null | https://raw.githubusercontent.com/mlang/chessIO/8f1bddf684193438fd2f3252b9746e29069abbb4/test/polyglot/Polyglot.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import Game.Chess
import Game.Chess.Polyglot
import Test.HUnit
tests = test
[ "t1" ~: "start position" ~: hashPosition startpos ~=? 0x463b96181691fc9c
, "t2" ~: "after e4" ~: hashPosition "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1" ~=? 0x823c9b50fd... |
92a5bdbaf2f14b6e8202b5567f7c723c5606731fe06472329869e5245628c31f | jumarko/clojure-experiments | anagram_finder.clj | (ns four-clojure.anagram-finder)
;;;
;;; Write a function which finds all the anagrams in a vector of words.
Word x is an anagram of word y if all the letters in x can be rearranged in a different order to form y.
;;; Your function should return a set of sets, where each sub-set is a group of words which are anagra... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/anagram_finder.clj | clojure |
Write a function which finds all the anagrams in a vector of words.
Your function should return a set of sets, where each sub-set is a group of words which are anagrams of each other.
words which have the same frequencies of characters are anagrams
using thread macro - more readable? | (ns four-clojure.anagram-finder)
Word x is an anagram of word y if all the letters in x can be rearranged in a different order to form y.
Each sub - set should have at least two words . Words without anagrams should not be included in the result .
(defn find-anagrams [words]
(set (filter #(> (count %) 1)
... |
58e105875f15e8050d042367ed89e0f16f0805c8397e510ccbcdbf08aa2259c1 | mpickering/eventlog2html | Args.hs | {-# LANGUAGE OverloadedStrings #-}
-- Warning turned off for CI
{-# OPTIONS_GHC -Wwarn=unused-imports #-}
module Eventlog.Args
(
args
, argsInfo
, Args(..)
, Option(..)
, Sort(..)
, defaultArgs
) where
import Options.Applicative
import Data.Text (Text)
-- Used for GHC 8.6.5
import Data.Semigroup ((<>... | null | https://raw.githubusercontent.com/mpickering/eventlog2html/327463a1d5377f6812607e0b9154d87ba02259f4/src/Eventlog/Args.hs | haskell | # LANGUAGE OverloadedStrings #
Warning turned off for CI
# OPTIONS_GHC -Wwarn=unused-imports #
Used for GHC 8.6.5
^ By default, only traceMarkers are included.
This option enables the inclusion of traceEvents. | module Eventlog.Args
(
args
, argsInfo
, Args(..)
, Option(..)
, Sort(..)
, defaultArgs
) where
import Options.Applicative
import Data.Text (Text)
import Data.Semigroup ((<>))
import Control.Applicative (optional)
data Option
= ShowVersion
| Run Args
data Sort = Size | StdDev | Name | Gradient... |
ad86d44e1690f6683cc87352c5019167973bf955b019730e9ae844d0ebde9298 | thheller/shadow-cljsjs | ar_ma.cljs | (ns cljsjs.moment.locale.ar-ma
(:require ["moment/locale/ar-ma"]))
| null | https://raw.githubusercontent.com/thheller/shadow-cljsjs/eaf350d29d45adb85c0753dff77e276e7925a744/src/main/cljsjs/moment/locale/ar_ma.cljs | clojure | (ns cljsjs.moment.locale.ar-ma
(:require ["moment/locale/ar-ma"]))
| |
9f195156ee9626d734d124f8d6baebc71f22daa2691709e6afd715038378411d | grin-compiler/grin | TypeEnvDefs.hs | # LANGUAGE DeriveDataTypeable , , DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Grin.TypeEnvDefs where
import Data.Data
import Data.Map (Map)
import Data.Vector (Vector)
import Data.Monoid
import Control.DeepSeq
import GHC.Generics (Generic)
import Lens.Micro.Platform
import Grin.SyntaxDefs
type NodeSet = ... | null | https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/src/Grin/TypeEnvDefs.hs | haskell | dependent type constructions to describe deconstructed nodes
tag with it's corresponding node set domain
tag variable name that holds the node tag on which the item type depends
item index in the node | # LANGUAGE DeriveDataTypeable , , DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Grin.TypeEnvDefs where
import Data.Data
import Data.Map (Map)
import Data.Vector (Vector)
import Data.Monoid
import Control.DeepSeq
import GHC.Generics (Generic)
import Lens.Micro.Platform
import Grin.SyntaxDefs
type NodeSet = ... |
34c3a480d5563df0338fd176f68f043ec2e82579a899a8f538f3d664075ecce2 | tweag/asterius | endianness.hs | import System.Environment
import System.Process
main :: IO ()
main = do
args <- getArgs
callProcess "ahc-link" $ ["--input-hs", "test/endianness/endianness.hs", "--run"] <> args
| null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/endianness.hs | haskell | import System.Environment
import System.Process
main :: IO ()
main = do
args <- getArgs
callProcess "ahc-link" $ ["--input-hs", "test/endianness/endianness.hs", "--run"] <> args
| |
cb0166c74faf8bf0de8cfdf976d99dce3f58ead6e02e5f4f9ca3f35138a4787f | green-labs/bootcamp-aoc | aoc2018_6.clj | (ns aoc2018_6)
파트 1
입력 : 좌표의 쌍이 N개 주어짐
1 , 1
1 , 6
8 , 3
3 , 4
5 , 5
8 , 9
;; 각 점은 1 tick이 지날때 마다 상,하,좌,우로 증식함.
;; ..........
.A ........
;; ..........
;; ........C.
;; ...D......
;; .....E....
;; .B........
;; ..........
;; ..........
;; ........F.
;; aaaaa.cccc
;; aAaaa.cccc
;; a... | null | https://raw.githubusercontent.com/green-labs/bootcamp-aoc/d5475cd754d07ca32b891cdc8ba53c55c1d44913/clojure/src/aoc2018_6.clj | clojure | 각 점은 1 tick이 지날때 마다 상,하,좌,우로 증식함.
..........
..........
........C.
...D......
.....E....
.B........
..........
..........
........F.
aaaaa.cccc
aAaaa.cccc
aaaddecccc
aadddeccCc
..dDdeeccc
bb.deEeecc
bBb.eeee..
bbb.eeefff
bbb.eeffff
bbb.ffffFf
..........
..........
..###E#...... | (ns aoc2018_6)
파트 1
입력 : 좌표의 쌍이 N개 주어짐
1 , 1
1 , 6
8 , 3
3 , 4
5 , 5
8 , 9
.A ........
여기서 . 으로 표기된 부분은 각 출발 지점으로부터 ' 같은 거리'에 있는 부분을 뜻함 .
맵 크기에는 제한이 없어 무한으로 뻗어나간다고 할 때 , 가장 큰 유한한 면적의 크기를 반환 ( part-1 )
파트 2
안전(safe ) 한 지역은 근원지'들'로부터의 맨하탄거리(Manhattan distance , 격자를 최단 거리)의 ' 합'이 N ... |
d99a337a602230bb19419060625728196251ce618ad824dec1e395103de5a955 | bos/rwh | TypeConstraint.hs | module TypeConstraint where
- snippet OrdStack -
data (Ord a) => OrdStack a = Bottom
| Item a (OrdStack a)
deriving (Show)
- /snippet OrdStack -
{-- snippet isIncreasing --}
isIncreasing :: (Ord a) => OrdStack a -> Bool
isIncreasing (Item a rest@(Item b _))
... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch10/TypeConstraint.hs | haskell | - snippet isIncreasing -
- /snippet isIncreasing -
- snippet push -
- /snippet push - | module TypeConstraint where
- snippet OrdStack -
data (Ord a) => OrdStack a = Bottom
| Item a (OrdStack a)
deriving (Show)
- /snippet OrdStack -
isIncreasing :: (Ord a) => OrdStack a -> Bool
isIncreasing (Item a rest@(Item b _))
| a < b = isIncreasing re... |
77d93abeaf5baa6ef199e7c036ac91b698b205465245894445e4cd3e8d698d3a | clojars/clojars-web | setup.clj | (ns clojars.dev.setup
"Tools to setup a dev db."
(:require
[clojars.config :refer [config]]
[clojars.db :as db]
[clojars.file-utils :as fu]
[clojars.search :as search]
[clojars.stats :as stats]
[clojure.java.io :as io]
[clojure.java.jdbc :as jdbc]
[clojure.string :as str])
(:import
(org... | null | https://raw.githubusercontent.com/clojars/clojars-web/bf6335cb61da6e7051648a4b99a9372da5f74a1f/src/clojars/dev/setup.clj | clojure | TODO: If there are more places that require this, move to a utility location. | (ns clojars.dev.setup
"Tools to setup a dev db."
(:require
[clojars.config :refer [config]]
[clojars.db :as db]
[clojars.file-utils :as fu]
[clojars.search :as search]
[clojars.stats :as stats]
[clojure.java.io :as io]
[clojure.java.jdbc :as jdbc]
[clojure.string :as str])
(:import
(org... |
4a5260769bb4759deabc93d59174dc5240c4b60e2a0ec6ab840a2c4d3f1db08d | eugeneia/athens | jh.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
jh.lisp -- implementation of the JH hash function
(in-package :crypto)
;;;
;;; Parameters
;;;
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +jh-rounds+ 42)
(defconstant +jh-block-size+ 64)
;;; Initial hash values
(defconst +jh224-h0+
... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/ironclad-v0.40/src/digests/jh.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
Parameters
Initial hash values
Round constants
Transformations
Rounds
Save the new state
Try to fill the buffer with the new data
Process data in buffer
Process data in message
Put remaining message data in buffer
Save the new state
Set the rest of the byte... | jh.lisp -- implementation of the JH hash function
(in-package :crypto)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant +jh-rounds+ 42)
(defconstant +jh-block-size+ 64)
(defconst +jh224-h0+
(make-array 16
:element-type '(unsigned-byte 64)
:initial-con... |
f37ce752990e3e6da04b2e4532c2e3f0870531d9ab7396c3ba71b4bb5b756707 | abdulapopoola/SICPBook | Ex3.66.scm | #lang racket
(define (integers-starting-from n)
(stream-cons n (integers-starting-from (+ n 1))))
(define integers (integers-starting-from 1))
(define (interleave s1 s2)
(if (stream-empty? s1)
s2
(stream-cons
(stream-first s1)
(interleave s2 (stream-rest s1)))))
(define (pairs s t)
... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%203/3.5/Ex3.66.scm | scheme | #lang racket
(define (integers-starting-from n)
(stream-cons n (integers-starting-from (+ n 1))))
(define integers (integers-starting-from 1))
(define (interleave s1 s2)
(if (stream-empty? s1)
s2
(stream-cons
(stream-first s1)
(interleave s2 (stream-rest s1)))))
(define (pairs s t)
... | |
d5d68fc7e46d4aa4f33e8d830f8cb80b4f67c708efb6e5b10f3d077dae11d5c3 | ucsd-progsys/dsolve | fft.ml | let pi = 3.14
* * by : , , 05 Jan 1993
* * Modified : to work with hist benchmark routines .
* * Translated from C to : , 07 Nov 1998
** by: Dave Edelblute, , 05 Jan 1993
** Modified: R. Mayer to work with hist benchmark routines.
** Translated from C to de Caml: Hongwei Xi, 07 Nov 1998
*)
let two_pi ... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/PLDI2008/fft.ml | ocaml | we know literally nothing about a, a3
so not carrying them through the loop is sound
out_of_bounds
pmr: is this going to cause a problem?
ming: we aren't trying to prove anything over floats?
in print_float zm; print_newline ()
** by: Dave Edelblute, , 05 Jan 1993
** Modified: R. Mayer to work with hist benc... | let pi = 3.14
* * by : , , 05 Jan 1993
* * Modified : to work with hist benchmark routines .
* * Translated from C to : , 07 Nov 1998
** by: Dave Edelblute, , 05 Jan 1993
** Modified: R. Mayer to work with hist benchmark routines.
** Translated from C to de Caml: Hongwei Xi, 07 Nov 1998
*)
let two_pi ... |
7d43c964e946ff5999b88aac65506a204bb168915f68d4d210ca84bfd1bf23da | typeable/compaREST | Main.hs | module Main (main) where
import Control.Monad
import Control.Monad.Except
import Data.Aeson
import qualified Data.ByteString.Lazy as BSL
import Data.Default
import Data.Maybe
import Data.OpenApi.Compare.Options
import Data.OpenApi.Compare.Run
import qualified Data.Text.IO as T
import qualified Data.Yaml as Yaml
import... | null | https://raw.githubusercontent.com/typeable/compaREST/6d8a67339c0e7b20a6c721eec7a2db093a0311fc/app/Main.hs | haskell | module Main (main) where
import Control.Monad
import Control.Monad.Except
import Data.Aeson
import qualified Data.ByteString.Lazy as BSL
import Data.Default
import Data.Maybe
import Data.OpenApi.Compare.Options
import Data.OpenApi.Compare.Run
import qualified Data.Text.IO as T
import qualified Data.Yaml as Yaml
import... | |
f68f877157c78519a2254c7bad20803c4c3ba2e852b80f86e77957a4d398d530 | deadpendency/deadpendency | ReportGeneratorHandler.hs | # LANGUAGE DataKinds #
module RG.Handler.ReportGeneratorHandler
( reportGeneratorHandler,
ReportGeneratorRoute,
)
where
import Common.Effect.AppEventEmit.AppEventEmit
import Common.Effect.AppEventEmit.Model.AppEventMessage (AppEventMessage (..))
import Common.Effect.InterchangeEventLoad.InterchangeEventLoad (... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/report-generator/src/RG/Handler/ReportGeneratorHandler.hs | haskell | decode queue event and log and put in state
assess dependencies
produce the report
publish result to the queue
finish up | # LANGUAGE DataKinds #
module RG.Handler.ReportGeneratorHandler
( reportGeneratorHandler,
ReportGeneratorRoute,
)
where
import Common.Effect.AppEventEmit.AppEventEmit
import Common.Effect.AppEventEmit.Model.AppEventMessage (AppEventMessage (..))
import Common.Effect.InterchangeEventLoad.InterchangeEventLoad (... |
db4068fdb55472f858f1da925e4e85e297e8f2abe8807d3a593e4be4b57eaabd | lwhjp/racket-jni | jni.rkt | #lang racket/base
(require (for-syntax racket/base
racket/syntax)
racket/class
ffi/unsafe
ffi/unsafe/define
"error.rkt"
"interface.rkt"
"types.rkt")
(provide (all-defined-out))
;;
;; JNI library
;;
(define-cstruct _JavaVMOption
([optionStr... | null | https://raw.githubusercontent.com/lwhjp/racket-jni/0d404ffaffbe3768ed0b1986b477c0dede55385e/private/jni.rkt | racket |
JNI library
hacky function for testing
| #lang racket/base
(require (for-syntax racket/base
racket/syntax)
racket/class
ffi/unsafe
ffi/unsafe/define
"error.rkt"
"interface.rkt"
"types.rkt")
(provide (all-defined-out))
(define-cstruct _JavaVMOption
([optionString _string/locale]
... |
177c930e44e39781813b1ee3bd0ca0d6a1703078f5a61985753b826cab58ba2a | ocaml-multicore/tezos | ticket_hash_repr.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_protocol/ticket_hash_repr.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN A... |
1fc707ca888dd8e28b46837c6ee0f364610f93f59a20dd146ef5ae8da3ba201f | appleshan/cl-http | echo.lisp | (This file must be converted with BinHex 4.0)
:#f9MD'mZFf0bDA"d!&4&@&48EhP6!*!%"cm!!!)-`Y9`FQp`CA*dH5"MFQaQ)$S
J+%&63dP*)'0SBA*KBh4PFL!a-bNJ*L!S390$58NJBfKKFQ&MG'9b)$%`+3d0F(*
[F'9bG(NJD(4dF&ma-&pSC@&NCA)J1L!L5&488#ma,M!J-M!`)%p,)L!Q)'0bE'B
J*L!L8f9bGQ9b1L"*ER4PFQ&MG'P[EL"AC@*69%&5,c-L)#BJBh*XCL!Q)-)0#5*
058e&,9CPFR0TE... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/mcl/contrib/tnorderhaug/cgi/echo.lisp | lisp | (This file must be converted with BinHex 4.0)
:#f9MD'mZFf0bDA"d!&4&@&48EhP6!*!%"cm!!!)-`Y9`FQp`CA*dH5"MFQaQ)$S
J+%&63dP*)'0SBA*KBh4PFL!a-bNJ*L!S390$58NJBfKKFQ&MG'9b)$%`+3d0F(*
[F'9bG(NJD(4dF&ma-&pSC@&NCA)J1L!L5&488#ma,M!J-M!`)%p,)L!Q)'0bE'B
J*L!L8f9bGQ9b1L"*ER4PFQ&MG'P[EL"AC@*69%&5,c-L)#BJBh*XCL!Q)-)0#5*
058e&,9CPFR0TE... | |
be3e043d4742408272fbe84e3736a9070fd3d4adfefeebe79a92177040ed4794 | fujita-y/ypsilon | 132.scm | #!nobacktrace
(define-library (srfi 132)
(import (srfi 132 sorting))
(export list-sorted?
vector-sorted?
list-sort
vector-sort
list-stable-sort
vector-stable-sort
list-sort!
vector-sort!
list-stable-sort!
vector-stable-sort!
... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/c68af44bad59eb26114c060d1689d8fe65cc895f/sitelib/srfi/132.scm | scheme | #!nobacktrace
(define-library (srfi 132)
(import (srfi 132 sorting))
(export list-sorted?
vector-sorted?
list-sort
vector-sort
list-stable-sort
vector-stable-sort
list-sort!
vector-sort!
list-stable-sort!
vector-stable-sort!
... | |
0ab978f6cd067a219955ba00c08695760eb5a17b1bdf18ba4897b4bfe1aba2ab | nuprl/gradual-typing-performance | runner.rkt | #lang racket
;; deterministic seed
(random-seed 17)
(dynamic-require "gofish.rkt" #f)
| null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/benchmarks/gofish/both/runner.rkt | racket | deterministic seed | #lang racket
(random-seed 17)
(dynamic-require "gofish.rkt" #f)
|
b9e06c53867e8d61eaa7921e287bbc45e6aa919081a6ce4c6755fc2743ead842 | esl/MongooseIM | graphql_mnesia_SUITE.erl | -module(graphql_mnesia_SUITE).
-include_lib("eunit/include/eunit.hrl").
-compile([export_all, nowarn_export_all]).
-import(distributed_helper, [require_rpc_nodes/1, mim/0, mim2/0, rpc/4]).
-import(domain_helper, [host_type/1]).
-import(mongooseimctl_helper, [rpc_call/3]).
-import(graphql_helper, [execute_command/4, e... | null | https://raw.githubusercontent.com/esl/MongooseIM/16e1546fb9396e1768596520fbe6d978404b3a4c/big_tests/tests/graphql_mnesia_SUITE.erl | erlang | Admin tests
Domain admin tests
--------------------------------------------------------------------------------------------------
Helpers
-------------------------------------------------------------------------------------------------- | -module(graphql_mnesia_SUITE).
-include_lib("eunit/include/eunit.hrl").
-compile([export_all, nowarn_export_all]).
-import(distributed_helper, [require_rpc_nodes/1, mim/0, mim2/0, rpc/4]).
-import(domain_helper, [host_type/1]).
-import(mongooseimctl_helper, [rpc_call/3]).
-import(graphql_helper, [execute_command/4, e... |
cb516b564e9566e1bb0d565381a414e7a91742a0883d173fa3882f70c60eb5e5 | GaloisInc/heapster-saw | TypeChecker.hs | {-# Language GADTs #-}
# Language RecordWildCards #
{-# Language FlexibleContexts #-}
{-# Language LambdaCase #-}
{-# Language BlockArguments #-}
{-# Language RankNTypes #-}
{-# Language TemplateHaskell #-}
{-# Language QuasiQuotes #-}
{-# Language TypeOperators #-}
{-# Language DataKinds #-}
{-# Language ViewPatterns ... | null | https://raw.githubusercontent.com/GaloisInc/heapster-saw/12da686a74901058961dc7b29aa1a011ed1d4eef/src/Verifier/SAW/Heapster/TypeChecker.hs | haskell | # Language GADTs #
# Language FlexibleContexts #
# Language LambdaCase #
# Language BlockArguments #
# Language RankNTypes #
# Language TemplateHaskell #
# Language QuasiQuotes #
# Language TypeOperators #
# Language DataKinds #
# Language ViewPatterns #
# Language ImportQualifiedPost #
# Language ScopedTypeVariables #... | # Language RecordWildCards #
module Verifier.SAW.Heapster.TypeChecker (
Tc, startTc,
TypeError(..),
tcFunPerm,
tcCtx,
tcType,
tcExpr,
tcValPerm,
inParsedCtxM,
tcAtomicPerms,
tcValPermInCtx,
tcSortedMbValuePerms,
) where
import Control.Monad
import Data.Functor.Product
import Data.Functor.Cons... |
135c3b4781a341a6326c5bf94ea04c747f59645b832b62874d07e1a72f7febb7 | helins/medium.cljc | dev.cljc | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns helins.medium.dev
"For daydreaming at the REPL."
{:author "Adam Helinski"}
(:require [helins.medium :as medium]))
;;;;;;;;;;
... | null | https://raw.githubusercontent.com/helins/medium.cljc/29ef3b42c741be1a27efb8b8ea343a55b0c95544/src/dev/helins/medium/dev.cljc | clojure | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns helins.medium.dev
"For daydreaming at the REPL."
{:author "Adam Helinski"}
(:require [helins.medium :as medium]))
(comment
... | |
5eefe2c583f7a2cb0747d77e4a9e0f2e1e85a81a8065ef48aabfd3473a3efe03 | ondrap/mapbox-filter | OldStyleConvert.hs | {-# LANGUAGE OverloadedStrings #-}
module Mapbox.OldStyleConvert where
import qualified Data.Aeson as AE
import Data.Aeson (toJSON, Value(..))
import Data.Foldable (toList)
import qualified Data.Text as T
-- | Convert deprecated old-style filter to a new-style expression filter
convertToNew :: AE.Value -> Either Stri... | null | https://raw.githubusercontent.com/ondrap/mapbox-filter/77e0477664901f966d8bbf3801e9c84ea576c677/src/Mapbox/OldStyleConvert.hs | haskell | # LANGUAGE OverloadedStrings #
| Convert deprecated old-style filter to a new-style expression filter | module Mapbox.OldStyleConvert where
import qualified Data.Aeson as AE
import Data.Aeson (toJSON, Value(..))
import Data.Foldable (toList)
import qualified Data.Text as T
convertToNew :: AE.Value -> Either String AE.Value
convertToNew (AE.Array arr)
| (String fname:args) <- toList arr = runFunc fname args
where
... |
d42f5555677dd7baebf48d54c04b863a8f4d77108594219ddc298da3c8f7fd64 | programaker-project/Programaker-Core | automate_rest_api_cors.erl | -module(automate_rest_api_cors).
-export([set_headers/1]).
set_headers(Req) ->
Req1 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Methods">>, <<"GET, POST, PUT, PATCH, DELETE, OPTIONS">>, Req),
Req2 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Origin">>, <<"*">>, Req1),
Req3 = cowboy_req:se... | null | https://raw.githubusercontent.com/programaker-project/Programaker-Core/ef10fc6d2a228b2096b121170c421f5c29f9f270/backend/apps/automate_rest_api/src/automate_rest_api_cors.erl | erlang | -module(automate_rest_api_cors).
-export([set_headers/1]).
set_headers(Req) ->
Req1 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Methods">>, <<"GET, POST, PUT, PATCH, DELETE, OPTIONS">>, Req),
Req2 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Origin">>, <<"*">>, Req1),
Req3 = cowboy_req:se... | |
d482a6d767882d0844bda8051c22408734493aeb7ca12cf1330a1b828f943b4e | msantos/erlang-libvirt | vert_tests.erl | Copyright ( c ) 2012 - 2013 , < >
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of condition... | null | https://raw.githubusercontent.com/msantos/erlang-libvirt/561327d42aeaf11c7e72d65e8c72b05e404ea040/test/vert_tests.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in bi... | Copyright ( c ) 2012 - 2013 , < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,
BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF U... |
b54ef3b2c942defd58e236e50a9007c8bee71dff734f08c657d5ce6516b10402 | snapframework/snap | TestCommon.hs | module Snap.TestCommon where
------------------------------------------------------------------------------
import Control.Exception (try, SomeException)
import Control.Monad.Trans (lift)
import qualified Data.Text as T
import qualified GHC.Read ... | null | https://raw.githubusercontent.com/snapframework/snap/d63110d7b2776ccba0336a69438c84f106f60567/test/suite/Snap/TestCommon.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------... | module Snap.TestCommon where
import Control.Exception (try, SomeException)
import Control.Monad.Trans (lift)
import qualified Data.Text as T
import qualified GHC.Read as R
import Test.HUnit (Assert... |
a41d09eafda1a4bc6dd92be75fbf26c9b8bbc13f03bc480aa5424959c2edd2b0 | delph-in/zhong | Version.lsp | -*- Mode : TDL ; Coding : utf-8 -*-
(in-package :common-lisp-user)
(defparameter *grammar-version* "Zhong-zhs (2018-03-30)")
| null | https://raw.githubusercontent.com/delph-in/zhong/e08dab713d7ff1e4e903e8c1e2bb01fda9aa664b/cmn/zhs/Version.lsp | lisp | Coding : utf-8 -*- | (in-package :common-lisp-user)
(defparameter *grammar-version* "Zhong-zhs (2018-03-30)")
|
2b6cca3b6acc97a8743716f52d82fcd69115fb4ea47d747b254467965bdd17d5 | cmonty/brainiac | pagerduty_schedules.clj | (ns brainiac.test.helpers.pagerduty-schedules
(:use [brainiac.helpers.pagerduty-schedules]
[clojure.test]
[clojure.contrib.mock]))
(defn schedules-json [name email]
(str "{\"total\":1,\"entries\":[{\"end\":\"2012-01-23T08:55:00-06:00\",\"start\":\"2012-01-23T08:55:00-06:00\",\"user\":{\"name\":\"" ... | null | https://raw.githubusercontent.com/cmonty/brainiac/f0e1e1e112e1b10f3f135d959c34aa8b7f2ca086/test/brainiac/test/helpers/pagerduty_schedules.clj | clojure | (ns brainiac.test.helpers.pagerduty-schedules
(:use [brainiac.helpers.pagerduty-schedules]
[clojure.test]
[clojure.contrib.mock]))
(defn schedules-json [name email]
(str "{\"total\":1,\"entries\":[{\"end\":\"2012-01-23T08:55:00-06:00\",\"start\":\"2012-01-23T08:55:00-06:00\",\"user\":{\"name\":\"" ... | |
0113b0436ea12ea9d7fc9531b5445ec1114441a56de311692710337edb57fea6 | mransan/ocaml-protoc | example03.ml | let () =
let v = Example03_types.Some "This is an example" in
Format.fprintf Format.std_formatter "%a\n" Example03_pp.pp_string_some v
| null | https://raw.githubusercontent.com/mransan/ocaml-protoc/e43b509b9c4a06e419edba92a0d3f8e26b0a89ba/src/examples/example03.ml | ocaml | let () =
let v = Example03_types.Some "This is an example" in
Format.fprintf Format.std_formatter "%a\n" Example03_pp.pp_string_some v
| |
6fe3637c1349179079311b3b89a5796592d2f1fc03f252ee3fac7c2b17622e2c | ocaml-flambda/ocaml-jst | parmatch.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/b1f0cf9f9114128db609bdd5a1edfda1e3144a30/typing/parmatch.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Asttypes
open Types
open Typedtree
Utilities for building patterns
let make_pat de... |
b115d302e61ff1698cf250061e90686c8cc00c7341aa094aee743ba93c1a5b47 | ArulselvanMadhavan/haskell-first-principles | ex_Eq.hs | data TisAnInteger =
TisAnInteger
instance Eq TisAnInteger where
(==) TisAnInteger TisAnInteger = True
data TwoIntegers =
Two Integer Integer
instance Eq TwoIntegers where
(==) (Two a b) (Two c d) =
(a == c) && (b == d)
data StringOrInt =
TisAnInt Int
| TisAString String
instance Eq S... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter6/src/ex_Eq.hs | haskell | data TisAnInteger =
TisAnInteger
instance Eq TisAnInteger where
(==) TisAnInteger TisAnInteger = True
data TwoIntegers =
Two Integer Integer
instance Eq TwoIntegers where
(==) (Two a b) (Two c d) =
(a == c) && (b == d)
data StringOrInt =
TisAnInt Int
| TisAString String
instance Eq S... | |
38ad9760bf07629a1c4571bafef032b977cf3c837c284d8daf5be5bd5adb2d87 | monadbobo/ocaml-core | hash_set.ml | module Hashtbl = Core_hashtbl
module List = StdLabels.List
open Sexplib
open Sexplib.Conv
open With_return
open Result.Export
open Hash_set_intf
module Hashable = Hashtbl.Hashable
type 'a t = ('a, unit) Hashtbl.t
type 'a hash_set = 'a t
type 'a elt = 'a
module type S = S with type 'a hash_set = 'a t
... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/hash_set.ml | ocaml | module Hashtbl = Core_hashtbl
module List = StdLabels.List
open Sexplib
open Sexplib.Conv
open With_return
open Result.Export
open Hash_set_intf
module Hashable = Hashtbl.Hashable
type 'a t = ('a, unit) Hashtbl.t
type 'a hash_set = 'a t
type 'a elt = 'a
module type S = S with type 'a hash_set = 'a t
... | |
cb667d06e6c17b4f9c93628ba91510f29b1e16173f970a22b29bd6c0728c7662 | pbrisbin/yesod-comments | Storage.hs | # OPTIONS_GHC -fno - warn - unused - binds #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE Overlo... | null | https://raw.githubusercontent.com/pbrisbin/yesod-comments/9242aadf4b356c8cd9764f85c87278d25977be42/Yesod/Comments/Storage.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE OverloadedStrings #
-----------------------------------------------------------------------------
|
License : as-is
Maintainer :
Stability : unstable
Portability :... | # OPTIONS_GHC -fno - warn - unused - binds #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
Module : Yesod . Comments . Storage
Copyright : ( c ) 2010
module Yesod.Comments.Storage
( persistStorage
, migrateComments
... |
6782c4c73cf7d2eb667d0ab34783e21573b7d923511d293a6e5f329f7b5c1d30 | baskeboler/cljs-karaoke-client | autocomplete.cljs | (ns cljs-karaoke.components.autocomplete
(:require [reagent.core :as reagent :refer [atom]]))
(defn ^:export autocomplete-input
([on-change-fn suggestions on-select-fn]
(let [value (atom "")
focused (atom false)]
(fn []
[:div.dropdown
{:class (when (and
@foc... | null | https://raw.githubusercontent.com/baskeboler/cljs-karaoke-client/bb6512435eaa436d35034886be99213625847ee0/src/main/cljs_karaoke/components/autocomplete.cljs | clojure | (ns cljs-karaoke.components.autocomplete
(:require [reagent.core :as reagent :refer [atom]]))
(defn ^:export autocomplete-input
([on-change-fn suggestions on-select-fn]
(let [value (atom "")
focused (atom false)]
(fn []
[:div.dropdown
{:class (when (and
@foc... | |
fb2cccbc42c758c52f851973c4a2fcacec4d21a9d15f18a4712492f414fe3c5d | HaskellCNOrg/snap-web | Tests.hs | {-# LANGUAGE OverloadedStrings #-}
module Controllers.Tests (tests) where
import qualified Controllers.TagsTest (tests)
import Test.Framework (Test, testGroup)
tests :: Test
tests = testGroup "Test.Controllers"
[
Controllers.TagsTest.tests
]
| null | https://raw.githubusercontent.com/HaskellCNOrg/snap-web/f104fd9b8fc5ae74fc7b8002f0eb3f182a61529e/tests/Controllers/Tests.hs | haskell | # LANGUAGE OverloadedStrings # |
module Controllers.Tests (tests) where
import qualified Controllers.TagsTest (tests)
import Test.Framework (Test, testGroup)
tests :: Test
tests = testGroup "Test.Controllers"
[
Controllers.TagsTest.tests
]
|
e526e781edc8c1e127ba84e9bb2204e2906c18ec676c2075a75ff2f3b99119f9 | clj-kondo/clj-kondo | forms.clj | (ns ^{:no-doc true} clj-kondo.impl.rewrite-clj.node.forms
(:require [clj-kondo.impl.rewrite-clj.node.protocols :as node]))
;; ## Node
(defrecord FormsNode [children]
node/Node
(tag [_]
:forms)
(printable-only? [_]
false)
(sexpr [_]
(let [es (node/sexprs children)]
(if (next es)
(li... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/626978461cbf113c376634cdf034d7262deb429f/parser/clj_kondo/impl/rewrite_clj/node/forms.clj | clojure | ## Node | (ns ^{:no-doc true} clj-kondo.impl.rewrite-clj.node.forms
(:require [clj-kondo.impl.rewrite-clj.node.protocols :as node]))
(defrecord FormsNode [children]
node/Node
(tag [_]
:forms)
(printable-only? [_]
false)
(sexpr [_]
(let [es (node/sexprs children)]
(if (next es)
(list* 'do es)... |
fbfe076d241e8693f0b7d9b6eb39bcb95fd101a928ccf34915d167737a06b926 | manuel-serrano/bigloo | aes.scm | (module __crypto-aes
(static
(final-class AES-Param
(state::bstring read-only)
(Nr::long read-only)
(w::bstring read-only)))
(import __crypto-block-ciphers
__crypto-util))
(define (key->param key)
(when (not (or (=fx (string-length key) 16)
(=fx (string-length key) 24)
(=f... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/crypto/src/Llib/aes.scm | scheme | hardcoded.
IMPORTANT: states must be column-major.
blit-string! is valid as states are column-major.
Nr == Number of rounds
shift to the right.
yeah. unrolled by hand...
Multiplications is gaulois field.
Nr = Number of rounds.
If the link should go down:
- times-2,3,etc can be precomputed. They are the the... | (module __crypto-aes
(static
(final-class AES-Param
(state::bstring read-only)
(Nr::long read-only)
(w::bstring read-only)))
(import __crypto-block-ciphers
__crypto-util))
(define (key->param key)
(when (not (or (=fx (string-length key) 16)
(=fx (string-length key) 24)
(=f... |
a90f27ea328bdee2eb34d5d09ff2f88f3ce60210d081bbd2f171383c4c34bb28 | jsarracino/spyder | Expr.hs | # LANGUAGE LambdaCase #
module Language.Spyder.Translate.Expr (
translateExpr
, translateITW
, translateTy
, transWithGen
, translateVDecl
) where
import qualified Language.Spyder.AST.Imp as Imp
import qualified Language.Boogie.AST as BST
import qualified Language.Boogie.Position as Pos
translateBop :: I... | null | https://raw.githubusercontent.com/jsarracino/spyder/a2f6d08eb2a3907d31a89ae3d942b50aaba96a88/Language/Spyder/Translate/Expr.hs | haskell | huh. i think this code, and the index code, don't play well...
the index code converts a[x][y] => a[x,y], while this converts
int[][] to [int][int]int, which should be indexed like a[x][y]
array variables are themselves, plus variables for dimensions
simple variables are just themselves | # LANGUAGE LambdaCase #
module Language.Spyder.Translate.Expr (
translateExpr
, translateITW
, translateTy
, transWithGen
, translateVDecl
) where
import qualified Language.Spyder.AST.Imp as Imp
import qualified Language.Boogie.AST as BST
import qualified Language.Boogie.Position as Pos
translateBop :: I... |
8404f4c61efed2d2de427469bb85dd98b4da003719693d4beabe6c2ed2a7db6a | kyleburton/sandbox | project.clj | (defproject hands-on-clojure "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:main hands-on-clojure.core
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [
[org.clojure/clojure "1.7.0"]
[org.jsoup/jsoup "1.7.2"]
... | null | https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/examples/clojure/hands-on-clojure/project.clj | clojure | (defproject hands-on-clojure "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:main hands-on-clojure.core
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [
[org.clojure/clojure "1.7.0"]
[org.jsoup/jsoup "1.7.2"]
... | |
e65f0fbd25cf5402b8072b8afade33dab0850a7ec3513de9987647b32b833470 | coalton-lang/coalton | fundep-tests.lisp | ;;;; fundep-tests.lisp
(in-package #:coalton-tests)
Fundep parsing
(deftest define-fundep-classes ()
(run-coalton-typechecker
'((coalton:define-class (C :a :b (:a -> :b)))))
(run-coalton-typechecker
'((coalton:define-class (C :a :b :c (:a :b -> :c)))))
(run-coalton-typechecker
'((coalton:define-cla... | null | https://raw.githubusercontent.com/coalton-lang/coalton/00b13af050d0da4201b319cc97a16273a7c0b939/tests/fundep-tests.lisp | lisp | fundep-tests.lisp
Instance conflicts
Trivially conflicting instances
Instances with unequal generality should conflict in either definition order
verify that the above example fails without the above fundep dec
verify that the correct type is inferred |
(in-package #:coalton-tests)
Fundep parsing
(deftest define-fundep-classes ()
(run-coalton-typechecker
'((coalton:define-class (C :a :b (:a -> :b)))))
(run-coalton-typechecker
'((coalton:define-class (C :a :b :c (:a :b -> :c)))))
(run-coalton-typechecker
'((coalton:define-class (C :a :b :c (:a -> :... |
861f915e755ccfd49d090c059883ff7becd40092f5b27c845fbe5b48196f10c5 | racket/picturing-programs | tiles.rkt | #lang racket/base
Modified 1/19/2005 to be compatible with new image.ss contracts .
; Modified 2/16/2005 to include stuff from world.ss as well as image.ss
; Modified 2/17/2005 to provide on-update-event (which requires overriding a few
; functions from world.ss)
; Modified 5/20/2005 to rename on-update-event as on-r... | null | https://raw.githubusercontent.com/racket/picturing-programs/9061b6c6f93a2aeba58a785a75c324225e12a47c/picturing-programs/private/tiles.rkt | racket | Modified 2/16/2005 to include stuff from world.ss as well as image.ss
Modified 2/17/2005 to provide on-update-event (which requires overriding a few
functions from world.ss)
Modified 5/20/2005 to rename on-update-event as on-redraw-event, and
handle pinholes more consistently in image-beside and image-above.
Modi... | #lang racket/base
Modified 1/19/2005 to be compatible with new image.ss contracts .
Modified 12/17/2007 to add crop - top , crop - bottom , crop - left , crop - right . Also utility functions slice - pic and unslice - pic .
Modified 1/3/2009 to fix bugs in crop- * and unslice - pic related to zero - sized image... |
6973395fe1b9f6caea29117955e860ef0b7939617bf96f9b4d72bbfaba20a76f | hstreamdb/hstream | StreamBench.hs | # LANGUAGE RecordWildCards #
module Main where
import Control.Concurrent (MVar, modifyMVar_, newMVar,
readMVar)
import Control.Monad (replicateM_, unless)
import qualified Criterion.Main as C
impo... | null | https://raw.githubusercontent.com/hstreamdb/hstream/24ee464c3eeddda13078c76708860532928a3f61/hstream-store/bench/StreamBench.hs | haskell | | To run the benchmark:
hstore - bench - stream --config /data / store / logdevice.conf --stream test --output bench.html --regress allocated : iters + RTS -T
# NOINLINE gloCache # | # LANGUAGE RecordWildCards #
module Main where
import Control.Concurrent (MVar, modifyMVar_, newMVar,
readMVar)
import Control.Monad (replicateM_, unless)
import qualified Criterion.Main as C
impo... |
27db35b529b59b82cebca24c21a470cfebd3b5ef4c123ff47309886a3b0f2163 | MagnusS/okra | lint.ml |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... | null | https://raw.githubusercontent.com/MagnusS/okra/aac577076a2fc39fcd27fca339d463fb10d324ca/src/lint.ml | ocaml | Check a single line for formatting errors returning
a list of error messages with the position |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... |
a79a674b575543852579f4d373b7212ed8856bffa8a3ed215d99db2ddc57c873 | AbstractMachinesLab/caramel | fiber.mli | * Concurrency library
This module implements
{ { : } " structured
concurrency " } .
This module implements
{{:} "structured
concurrency"}. *)
open! Stdune
(** {1 Generals} *)
(** Type of fiber. A fiber represent a suspended computation. Note that using
the same fiber twice will e... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/vendor/fiber/fiber.mli | ocaml | * {1 Generals}
* Type of fiber. A fiber represent a suspended computation. Note that using
the same fiber twice will execute it twice, which is probably not what you
want. To share the result of a fiber, use an [Ivar.t].
* Create a fiber that has already terminated.
* Converts a thunk to a fiber, making sure... | * Concurrency library
This module implements
{ { : } " structured
concurrency " } .
This module implements
{{:} "structured
concurrency"}. *)
open! Stdune
type 'a t
val return : 'a -> 'a t
val of_thunk : (unit -> 'a t) -> 'a t
val never : 'a t
module O : sig
* [ > > > ] is a sequ... |
e6ab485209e89352ae19a80b287b7f2c72889768736c8af00a0834ce345655ca | phaul/chess | Execute.hs | module Chess.Move.Execute
( makeMove
, makeMoveSimplified
, calcHash
) where
import Control.Lens hiding (to, from)
import Data.Word
import Data.Monoid
import Data.BitBoard
import Data.Square
import Data.ChessTypes
import qualified... | null | https://raw.githubusercontent.com/phaul/chess/b9c71a0389ed44360caed4b830208ce346211cb8/Chess/Move/Execute.hs | haskell | ----------------------------------------------------------------------------
| makes a move on the board
----------------------------------------------------------------------------
| same as makeMove except faster but only update where the pieces are
------------------------------------------------------------------... | module Chess.Move.Execute
( makeMove
, makeMoveSimplified
, calcHash
) where
import Control.Lens hiding (to, from)
import Data.Word
import Data.Monoid
import Data.BitBoard
import Data.Square
import Data.ChessTypes
import qualified... |
282f2c1802ba744f3b20cec03bf74fa0b7469b55c4a77f7b2fc989acc31024c1 | onyx-platform/onyx | nippy.clj | (ns onyx.compression.nippy
(:require [taoensso.nippy :as nippy :refer [fast-freeze fast-thaw]]))
(def messaging-compress-opts
{:v1-compatibility? false
:compressor nil
:encryptor nil
:password nil
:no-header? true})
(def messaging-compress
nippy/fast-freeze)
(def messaging-decompress-opts
mes... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/compression/nippy.clj | clojure | (ns onyx.compression.nippy
(:require [taoensso.nippy :as nippy :refer [fast-freeze fast-thaw]]))
(def messaging-compress-opts
{:v1-compatibility? false
:compressor nil
:encryptor nil
:password nil
:no-header? true})
(def messaging-compress
nippy/fast-freeze)
(def messaging-decompress-opts
mes... | |
0de8855a31241ac910afa3843b4be296b65730c70aa4d4e7fdbcd6a3dbdc310c | chetmurthy/ensemble | inter.ml | (**************************************************************)
(* INTER.ML *)
Author : , 10/96
(**************************************************************)
open Util
open Layer
open View
open Event
open Trans
(**************************************************************)
let name = Trace.filel "INTER"
(****... | null | https://raw.githubusercontent.com/chetmurthy/ensemble/8266a89e68be24a4aaa5d594662e211eeaa6dc89/ensemble/server/layers/vsync/inter.ml | ocaml | ************************************************************
INTER.ML
************************************************************
************************************************************
************************************************************
automata state
endpts I've seen anywhere
views merging with ... | Author : , 10/96
open Util
open Layer
open View
open Event
open Trans
let name = Trace.filel "INTER"
type header = NoHdr
type states =
| Normal
| Merging
| FailedMerge
| InstalledView
type state = {
have I seen an EBlockOk ?
}
let string_of_state = function
| Normal -> "Normal"
| Merging -... |
5ac6ff95e5b58870a25f3a2a93d87560aeeb80cd4051c02c410cb6e5f512c14f | facebookarchive/pfff | parse_java.mli |
(* the token list contains also the comment-tokens *)
type program_and_tokens =
Ast_java.program option * Parser_java.token list
exception Parse_error of Parse_info.info
(* This is the main function *)
val parse:
Common.filename (*javafile*) -> (program_and_tokens * Parse_info.parsing_stat)
(* may raise (Fail... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_java/parsing/parse_java.mli | ocaml | the token list contains also the comment-tokens
This is the main function
javafile
may raise (Failure "just:pb") when parse return None when have parse error
for generalized sgrep/spatch patterns
internal |
type program_and_tokens =
Ast_java.program option * Parser_java.token list
exception Parse_error of Parse_info.info
val parse:
val parse_program:
Common.filename -> Ast_java.program
val parse_string:
string -> (program_and_tokens * Parse_info.parsing_stat)
val parse_fuzzy:
Common.filename -> Ast_fuzzy.t... |
a1d41c37fb347d866db4e073d3ef99ac4997bec58f4bc7c151ce6f56a8860ab3 | YoshikuniJujo/funpaala | polish0.hs | import Text.Read
operators :: [(String, Integer -> Integer -> Integer)]
operators = [("+", (+)), ("-", (-)), ("*", (*)), ("/", div)]
polish :: [String] -> Maybe [Integer]
polish [] = Just []
polish (s : ss) = case lookup s operators of
Just o -> case polish ss of
Just (x : y : ns) -> Just $ x `o` y : ns
_ -> Not... | null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/15_fold/polish0.hs | haskell | import Text.Read
operators :: [(String, Integer -> Integer -> Integer)]
operators = [("+", (+)), ("-", (-)), ("*", (*)), ("/", div)]
polish :: [String] -> Maybe [Integer]
polish [] = Just []
polish (s : ss) = case lookup s operators of
Just o -> case polish ss of
Just (x : y : ns) -> Just $ x `o` y : ns
_ -> Not... | |
d38c67979ce33d9b10fe93b2a29d6c59839751263570fa1205be9d7ddf23f149 | crategus/cl-cffi-gtk | rtest-gtk-app-chooser-button.lisp | (def-suite gtk-app-chooser-button :in gtk-suite)
(in-suite gtk-app-chooser-button)
;;; --- Types and Values -------------------------------------------------------
;;; GtkAppChooserButton
(test gtk-app-chooser-button-class
;; Type check
(is (g-type-is-object "GtkAppChooserButton"))
;; Check the registered ... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/test/rtest-gtk-app-chooser-button.lisp | lisp | --- Types and Values -------------------------------------------------------
GtkAppChooserButton
Type check
Check the registered name
Check the type initializer
Check the parent
Check the children
Check the interfaces
Check the class properties
Get the names of the style properties.
Get the names of the ... | (def-suite gtk-app-chooser-button :in gtk-suite)
(in-suite gtk-app-chooser-button)
(test gtk-app-chooser-button-class
(is (g-type-is-object "GtkAppChooserButton"))
(is (eq 'gtk-app-chooser-button
(registered-object-type-by-name "GtkAppChooserButton")))
(is (eq (gtype "GtkAppChooserButton")
... |
79c656969a3a60dc265baea9a086641c28e78b089884baa90e9dd6ff7dcced16 | takikawa/racket-rsvg | info.rkt | #lang setup/infotab
(define version 0.1)
(define collection 'multi)
(define deps '("base" "draw-lib" "gui-lib" "pict-lib"))
(define build-deps '("pict-doc"
"scribble-lib" "rackunit-lib" "scribble-lib" "pict-lib"
"draw-doc" "racket-doc" "slideshow-doc"))
| null | https://raw.githubusercontent.com/takikawa/racket-rsvg/9a9c82801e40622238794fdac556339ac0a6c912/info.rkt | racket | #lang setup/infotab
(define version 0.1)
(define collection 'multi)
(define deps '("base" "draw-lib" "gui-lib" "pict-lib"))
(define build-deps '("pict-doc"
"scribble-lib" "rackunit-lib" "scribble-lib" "pict-lib"
"draw-doc" "racket-doc" "slideshow-doc"))
| |
a4f4375ac0594332e9bd85b7f3640a08c7c51e06f4fcef3cd7119871384aac0f | sgbj/MaximaSharp | zlaset.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/lapack/zlaset.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
320154733bc52bf81c07074ec0d23dea0927ea36aae9111c13ce6dfc290a6791 | shop-planner/shop3 | p16.lisp |
(IN-PACKAGE :SHOP2-ROVERS)
(DEFPROBLEM ROVERPROB16 ROVER
((OBJECTIVE OBJECTIVE4) (OBJECTIVE OBJECTIVE3)
(OBJECTIVE OBJECTIVE2) (OBJECTIVE OBJECTIVE1)
(OBJECTIVE OBJECTIVE0) (CAMERA CAMERA3) (CAMERA CAMERA2)
(CAMERA CAMERA1) (CAMERA CAMERA0) (WAYPOINT WAYPOINT11)
... | null | https://raw.githubusercontent.com/shop-planner/shop3/b04d12bdf83e40590fe44bb5c68952f3fd0b5b1d/shop3/examples/rovers/strips/p16.lisp | lisp |
(IN-PACKAGE :SHOP2-ROVERS)
(DEFPROBLEM ROVERPROB16 ROVER
((OBJECTIVE OBJECTIVE4) (OBJECTIVE OBJECTIVE3)
(OBJECTIVE OBJECTIVE2) (OBJECTIVE OBJECTIVE1)
(OBJECTIVE OBJECTIVE0) (CAMERA CAMERA3) (CAMERA CAMERA2)
(CAMERA CAMERA1) (CAMERA CAMERA0) (WAYPOINT WAYPOINT11)
... | |
c220520bd4e49ee6f693ec15f7504f14b5c3b4409d93b93242325bb4929bcc8f | uim/sigscheme | bench-let-loop.scm | (define loop
(lambda (i l)
(let ((a 0)
(b 1)
(c 2))
(if (< i l)
(loop (+ 1 i) l)
l))))
(write (loop 0 20000))
(newline)
| null | https://raw.githubusercontent.com/uim/sigscheme/ccf1f92d6c2a0f45c15d93da82e399c2a78fe5f3/bench/bench-let-loop.scm | scheme | (define loop
(lambda (i l)
(let ((a 0)
(b 1)
(c 2))
(if (< i l)
(loop (+ 1 i) l)
l))))
(write (loop 0 20000))
(newline)
| |
1c13671865952b8507389ac49fb2fc8c41fce73a145f2c5b077b48e2f178865d | lem-project/lem | defstruct-to-defclass.lisp | (defpackage :lem-lisp-syntax.defstruct-to-defclass
(:use :cl :lem-base)
(:export :defstruct-to-defclass)
#+sbcl
(:lock t))
(in-package :lem-lisp-syntax.defstruct-to-defclass)
(defvar *save-points* '())
(defun save-point (point)
(let ((new-point (copy-point point :left-inserting)))
(push new-point *save-... | null | https://raw.githubusercontent.com/lem-project/lem/4d8a9422ba961d9d32206e0435abfa762dceff0a/lib/lisp-syntax/defstruct-to-defclass.lisp | lisp | (defstruct |(structure-name ...
(defstruct |structure-name ...
(slot-name ... :type| type)
(slot-name ... :type |type)
(slot-name ... :type type|)
(slot-name ... :read-only| boolean)
(slot-name ... :read-only boolean|)
(defstruct structure-name (slot-name |init-form :type integer))
(defstruct structure-name (s... | (defpackage :lem-lisp-syntax.defstruct-to-defclass
(:use :cl :lem-base)
(:export :defstruct-to-defclass)
#+sbcl
(:lock t))
(in-package :lem-lisp-syntax.defstruct-to-defclass)
(defvar *save-points* '())
(defun save-point (point)
(let ((new-point (copy-point point :left-inserting)))
(push new-point *save-... |
9b5883576f2b5f5fd2d8ae549f066f27c9dbe55fd4b85141dc38763996a51be4 | hspec/sensei | sensei.hs | module Main (main) where
import System.Environment
import Paths_sensei
import Run
main :: IO ()
main = do
startupFile <- getDataFileName "startup.ghci"
getArgs >>= run "" startupFile
| null | https://raw.githubusercontent.com/hspec/sensei/f43a9386bafd46812dd68088b5fdfadfef722d0b/driver/sensei.hs | haskell | module Main (main) where
import System.Environment
import Paths_sensei
import Run
main :: IO ()
main = do
startupFile <- getDataFileName "startup.ghci"
getArgs >>= run "" startupFile
| |
933f52c8ed7b2833da6a07e0dbb2daef8a54934db7b9c4698879b98788f94419 | Clojure2D/clojure2d-examples | aabb.clj | (ns rt4.the-next-week.ch05f.aabb
(:require [rt4.the-next-week.ch05f.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05f/aabb.clj | clojure | (ns rt4.the-next-week.ch05f.aabb
(:require [rt4.the-next-week.ch05f.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | |
f364eaf163e436f699b31a3dd7bb0e176cbbf13698d8c17d32b4c2bf000df7d9 | headwinds/reagent-reframe-material-ui | template.cljs | (ns reagent.impl.template
(:require [react :as react]
[clojure.string :as string]
[clojure.walk :refer [prewalk]]
[reagent.impl.util :as util :refer [is-client]]
[reagent.impl.component :as comp]
[reagent.impl.batching :as batch]
[reagent.ratom :... | null | https://raw.githubusercontent.com/headwinds/reagent-reframe-material-ui/8a6fba82a026cfedca38491becac85751be9a9d4/resources/public/js/out/reagent/impl/template.cljs | clojure | Common utilities
Props conversion
Previous few functions copied for custom elements,
without mapping from class to className etc.
Only use ID from tag keyword if no :id in props already
Merge classes
Specialization for input components
This gets set from reagent.dom
The properites 'selectionStart' and 'selecti... | (ns reagent.impl.template
(:require [react :as react]
[clojure.string :as string]
[clojure.walk :refer [prewalk]]
[reagent.impl.util :as util :refer [is-client]]
[reagent.impl.component :as comp]
[reagent.impl.batching :as batch]
[reagent.ratom :... |
e5a599d6f6cc307ef49bbaa7684e5061f941f74e3e0c0e015c501e58292ee279 | Vigilans/hscc | Validate.hs | module Language.C.Semantic.Validate where
| null | https://raw.githubusercontent.com/Vigilans/hscc/d612c54f9263d90fb01673aea1820a62fdf62551/src/Language/C/Semantic/Validate.hs | haskell | module Language.C.Semantic.Validate where
| |
c4117fbc04ad2d9c0098dd8ff7cef00aa451ebfa2a3ec93c00f82e5b692bbd15 | Ferada/cl-mock | functions.lisp | -*- mode : lisp ; syntax : common - lisp ; coding : utf-8 - unix ; package : cl - mock - tests ; -*-
(in-package #:cl-mock-tests)
(in-suite cl-mock)
(def-test progf.calls-binding ()
(progf '(foo) (list (lambda () 23))
(is (eql 23 (foo)))))
(def-test dflet.calls-binding ()
(dflet ((foo () 23))
(is (eq... | null | https://raw.githubusercontent.com/Ferada/cl-mock/714a4122970d836e65a5a33f6bf6c6d99116325c/tests/functions.lisp | lisp | syntax : common - lisp ; coding : utf-8 - unix ; package : cl - mock - tests ; -*- |
(in-package #:cl-mock-tests)
(in-suite cl-mock)
(def-test progf.calls-binding ()
(progf '(foo) (list (lambda () 23))
(is (eql 23 (foo)))))
(def-test dflet.calls-binding ()
(dflet ((foo () 23))
(is (eql 23 (foo)))))
(declaim (inline foo/inline))
(defun foo/inline ()
23)
(def-test dflet.inline.works... |
de9067ce09900d79f54f579badb42197f3bbaa1b72fef74eb0f23ed2e59cdaad | kmi/irs | load.lisp | Mode : Lisp ; Package :
File created in WebOnto
(in-package "OCML")
(def-ontology trust-heuristic-classification
:includes (trust-profile classificationv2-class-map country-ontology cryptography)
:type :application
:namespaces (("crypt" cryptography))
:author "stefania" :allowed-editors ("john" ... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/ontologies/applications/trust-heuristic-classification/load.lisp | lisp | Package : |
File created in WebOnto
(in-package "OCML")
(def-ontology trust-heuristic-classification
:includes (trust-profile classificationv2-class-map country-ontology cryptography)
:type :application
:namespaces (("crypt" cryptography))
:author "stefania" :allowed-editors ("john" "alessio"))
|
fd12e0dca3d725c344cbc93af8f1b209bb9d7efca4525fa1997566c35d1fd20b | jwiegley/notes | Reflection.hs | # LANGUAGE FlexibleContexts #
module Reflection where
import Data.Proxy
import Data.Reflection
foo :: Reifies s Int => Proxy s -> IO Int
foo p = return $ reflect p
main :: IO ()
main = reify 10 $ \p -> do
x <- foo p
print x
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/misc/Reflection.hs | haskell | # LANGUAGE FlexibleContexts #
module Reflection where
import Data.Proxy
import Data.Reflection
foo :: Reifies s Int => Proxy s -> IO Int
foo p = return $ reflect p
main :: IO ()
main = reify 10 $ \p -> do
x <- foo p
print x
| |
659c8d87779d8fb8286bb30b776f7cbb71ac8ff7edca53f3a40722c6ddcc698f | footprintanalytics/footprint-web | dimension_test.clj | (ns metabase.models.dimension-test
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.dimension :refer [Dimension]]
[metabase.models.field :refer [Field]]
[metabase.models.serialization.hash :as serdes.hash]
[m... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/models/dimension_test.clj | clojure | (ns metabase.models.dimension-test
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.dimension :refer [Dimension]]
[metabase.models.field :refer [Field]]
[metabase.models.serialization.hash :as serdes.hash]
[m... | |
3b9ac7243777f405d7ea0e6e5a13e2cbec368c96b717c7275736709de8ae3f07 | haroldcarr/learn-haskell-coq-ml-etc | UseReader.hs | # LANGUAGE FlexibleContexts #
module UseReader where
import Control.Monad.Identity
import MonadReader
import Test.HUnit as T (Test (TestList), runTestTT)
import Test.HUnit.Util as U
{-# ANN module "HLint: ignore Reduce duplication" #-}
-------------------------... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/monads/m/src/UseReader.hs | haskell | # ANN module "HLint: ignore Reduce duplication" #
----------------------------------------------------------------------------
---------------------------------------------------------------------------- | # LANGUAGE FlexibleContexts #
module UseReader where
import Control.Monad.Identity
import MonadReader
import Test.HUnit as T (Test (TestList), runTestTT)
import Test.HUnit.Util as U
r :: Reader [String] [String]
rt :: ReaderT [Str... |
d2ec46492935d59276a1cc062321ddbe69ca2e837b90e1eb598c5339d3d8db6e | digital-asset/ghc | T6018fail.hs | # LANGUAGE TypeFamilyDependencies , DataKinds , UndecidableInstances , PolyKinds ,
MultiParamTypeClasses , FlexibleInstances #
MultiParamTypeClasses, FlexibleInstances #-}
module T6018fail where
import Data.Kind (Type)
import T6018Afail -- defines G, identical to F
imports H from , def... | null | https://raw.githubusercontent.com/digital-asset/ghc/323dc6fcb127f77c08423873efc0a088c071440a/testsuite/tests/typecheck/should_fail/T6018fail.hs | haskell | defines G, identical to F
Id is injective...
...but despite that we disallow a call to Id
P is not injective, although the user declares otherwise. This
should be rejected on the grounds of calling a type family in the
RHS.
this is not injective - not all injective type variables mentioned
Make sure we look thr... | # LANGUAGE TypeFamilyDependencies , DataKinds , UndecidableInstances , PolyKinds ,
MultiParamTypeClasses , FlexibleInstances #
MultiParamTypeClasses, FlexibleInstances #-}
module T6018fail where
import Data.Kind (Type)
imports H from , defines some equations for H
imports H from , d... |
4b9db1bf86582a9d4985df9beeb016c22be3d60f26778d4a92f49456e7f180ff | FreeProving/free-compiler | Pragma.hs | -- | This module contains the definition of comments and pragmas for our
-- intermediate language.
module FreeC.IR.Syntax.Pragma where
import FreeC.IR.SrcSpan
import FreeC.IR.Syntax.Name
import FreeC.Pretty
-------------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/IR/Syntax/Pragma.hs | haskell | | This module contains the definition of comments and pragmas for our
intermediate language.
-----------------------------------------------------------------------------
Comments --
-------------------------------------------------------------------... | module FreeC.IR.Syntax.Pragma where
import FreeC.IR.SrcSpan
import FreeC.IR.Syntax.Name
import FreeC.Pretty
Comments are collected during parsing . However , the final AST
contains no comments . ( see ' DecArgPragma ' ) are extracted
data Comment
= BlockComment { commentSrcSpa... |
072e5db32dcc6d5676dbf5d6549ed520df09d8878b5654267d7e43e993cc0a83 | bdeket/rktsicm | covariant-derivative.rkt | #lang racket/base
(require rackunit
"../../main.rkt"
"../helper.rkt"
)
(define (make-GCF R2-rect-basis)
(define (Gijk i j k)
(literal-manifold-function
(string->symbol
(string-append "G^"
(number->string i)
"_"
... | null | https://raw.githubusercontent.com/bdeket/rktsicm/e7bdc2190f85703b98e573afb5b5d8a440bad3c4/rktsicm/sicm/tests/calculus/covariant-derivative.rkt | racket | Note: arg-suppressor is in force from above.
independence - rect
independence - polar
simple version
((gamma m) delta) is the point on gamma advanced by delta. | #lang racket/base
(require rackunit
"../../main.rkt"
"../helper.rkt"
)
(define (make-GCF R2-rect-basis)
(define (Gijk i j k)
(literal-manifold-function
(string->symbol
(string-append "G^"
(number->string i)
"_"
... |
c5192edacafac520eaa31c4cd8707e746a10ee8faf55ea507e069035a12eed58 | kalxd/azelf | reader.rkt | #lang s-exp syntax/module-reader
azelf/main
| null | https://raw.githubusercontent.com/kalxd/azelf/bada24159034c867dbb8d4d2d33c62be59025ac6/lang/reader.rkt | racket | #lang s-exp syntax/module-reader
azelf/main
| |
9dd47d121e4fed84d78424847837bd961a2be54cfe59a95e1b8395b985d0e760 | m4dc4p/haskelldb | DBInfo.hs | -----------------------------------------------------------
-- |
Module :
Copyright : HWT Group ( c ) 2004 ,
-- License : BSD-style
--
Maintainer :
-- Stability : experimental
-- Portability : non-portable
--
This is the " core " file of the DBSpec files . It defines
-- a DBInfo an... | null | https://raw.githubusercontent.com/m4dc4p/haskelldb/a1fbc8a2eca8c70ebe382bf4c022275836d9d510/src/Database/HaskellDB/DBSpec/DBInfo.hs | haskell | ---------------------------------------------------------
|
License : BSD-style
Stability : experimental
Portability : non-portable
a DBInfo and important functions on it.
---------------------------------------------------------
| Defines a database layout, top level
^ The name of the database
^... | Module :
Copyright : HWT Group ( c ) 2004 ,
Maintainer :
This is the " core " file of the DBSpec files . It defines
module Database.HaskellDB.DBSpec.DBInfo
(DBInfo(..),TInfo(..),CInfo(..),DBOptions(..),makeDBSpec,
makeTInfo,makeCInfo,ppDBInfo,ppTInfo,ppCInfo,ppDBOptions,
dbInf... |
7964c8b20ee90e79016c82bd17c2445cddf732961469103d15179b0858138ec9 | ntoronto/pict3d | depth-range.rkt | #lang typed/racket
(require pict3d
math/flonum
typed/racket/gui
typed/racket/class)
(current-pict3d-width 512)
(current-pict3d-height 512)
(current-material (material #:ambient 0.1
#:diffuse 0.4
#:specular 0.5
... | null | https://raw.githubusercontent.com/ntoronto/pict3d/09283c9d930c63b6a6a3f2caa43e029222091bdb/pict3d/tests/depth-range.rkt | racket | #lang typed/racket
(require pict3d
math/flonum
typed/racket/gui
typed/racket/class)
(current-pict3d-width 512)
(current-pict3d-height 512)
(current-material (material #:ambient 0.1
#:diffuse 0.4
#:specular 0.5
... | |
69920caa1c6ef61ea24d22b5646cdc0c8af24d4632f92a841d875bb0b2b83cf1 | JamesLavin/ElixirZone | add_two.erl | -module(add_two).
-export([start/0, request/1, loop/0]).
% client function that starts the add_two process, registers it, and links to it
start() ->
process_flag(trap_exit, true),
AddTwoPid = spawn_link(add_two, loop, []),
register(add_two, AddTwoPid),
{ok, AddTwoPid}.
% client function to send request to add_two... | null | https://raw.githubusercontent.com/JamesLavin/ElixirZone/8572a8225745390fae329a304985885dec2934f7/Erlang_Fundamentals/Erlang102/spawn/add_two.erl | erlang | client function that starts the add_two process, registers it, and links to it
client function to send request to add_two process and interpret the response | -module(add_two).
-export([start/0, request/1, loop/0]).
start() ->
process_flag(trap_exit, true),
AddTwoPid = spawn_link(add_two, loop, []),
register(add_two, AddTwoPid),
{ok, AddTwoPid}.
request(Int) ->
add_two ! {request, self(), Int},
receive
{result, Result} -> Result;
{'EXIT', _Pid, Reason} -> {error,... |
70802c88fc2594ba1003c3bc7972405c61ed7724c32dff2a4225578027e391a4 | zack-bitcoin/amoveo | oracle_bets.erl | -module(oracle_bets).%
-export([test/0, new/3, increase/3, id/1,%
true/1, false/1, bad/1,%
write/2, get/2, root_hash/1, %add_bet/4,%
reward/3, delete/2, verify_proof/4,%
dict_add_bet/5, dict_get/2, dict_get/3, dict_delete/2,%
serialize/1, make_leaf/3, key_to_int/1,%
deserialize/1]).%
-i... | null | https://raw.githubusercontent.com/zack-bitcoin/amoveo/257f3e8cc07f1bae9df1a7252b8bc67a0dad3262/apps/amoveo_core/src/consensus/trees/oracle_bets.erl | erlang |
add_bet/4,%
returns {Shares, Tokens}%
{_, X, _} = active_oracles:read(OracleID, AORoot),%
false = X == empty,%
KL = constants:key_length()*8,%
KL = constants:key_length()*8,%
changed%
io:fwrite("\n"),%
Root... | dict_get(Key, Dict, _) ->
dict_get(Key, Dict).
Root0 = trees:empty_tree(oracle_bets),
|
113d804da6aa217231d66daf5c20d037433800dbb03c297d89c2df8403c5156c | synduce/Synduce | position_polynomial.ml | * @synduce --no - lifting
type nat =
| Z
| S of nat
type list =
| Nil
| Cons of int * list
type indexed_list =
| CNil
| CCons of int * int * indexed_list
let rec add_indices = function
| Nil -> CNil
| Cons (value, tl) -> CCons (value, length tl, add_indices tl)
and length = function
| Nil -> 0
... | null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/indexed_list/position_polynomial.ml | ocaml | * @synduce --no - lifting
type nat =
| Z
| S of nat
type list =
| Nil
| Cons of int * list
type indexed_list =
| CNil
| CCons of int * int * indexed_list
let rec add_indices = function
| Nil -> CNil
| Cons (value, tl) -> CCons (value, length tl, add_indices tl)
and length = function
| Nil -> 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.