Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
fcb5107c
Commit
fcb5107c
authored
Mar 05, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding static-canvas support; adding 7.6.3 bugfix N+1 for travis
parent
ef3a4612
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
140 additions
and
2 deletions
+140
-2
LICENSE
ihaskell-display/ihaskell-static-canvas/LICENSE
+20
-0
Setup.hs
ihaskell-display/ihaskell-static-canvas/Setup.hs
+2
-0
ihaskell-static-canvas.cabal
...splay/ihaskell-static-canvas/ihaskell-static-canvas.cabal
+73
-0
StaticCanvas.hs
...askell-static-canvas/src/IHaskell/Display/StaticCanvas.hs
+35
-0
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+5
-2
Util.hs
src/IHaskell/Eval/Util.hs
+5
-0
No files found.
ihaskell-display/ihaskell-static-canvas/LICENSE
0 → 100644
View file @
fcb5107c
Copyright (c) 2015 Andrew Gibiansky
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ihaskell-display/ihaskell-static-canvas/Setup.hs
0 → 100644
View file @
fcb5107c
import
Distribution.Simple
main
=
defaultMain
ihaskell-display/ihaskell-static-canvas/ihaskell-static-canvas.cabal
0 → 100644
View file @
fcb5107c
-- Initial ihaskell-static-canvas.cabal generated by cabal init. For
-- further documentation, see http://haskell.org/cabal/users-guide/
-- The name of the package.
name: ihaskell-static-canvas
-- The package version. See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.1.0.0
-- A short (one-line) description of the package.
synopsis: IHaskell display for static-canvas
-- A longer description of the package.
-- description:
-- URL for the project homepage or repository.
homepage: http://www.github.com/gibiansky/IHaskell
-- The license under which the package is released.
license: MIT
-- The file containing the license text.
license-file: LICENSE
-- The package author(s).
author: Andrew Gibiansky
-- An email address to which users can send suggestions, bug reports, and
-- patches.
maintainer: andrew.gibiansky@gmail.com
-- A copyright notice.
-- copyright:
-- category:
build-type: Simple
-- Extra files to be distributed with the package, such as examples or a
-- README.
-- extra-source-files:
-- Constraint on the version of Cabal needed to build this package.
cabal-version: >=1.10
library
-- Modules exported by the library.
exposed-modules: IHaskell.Display.StaticCanvas
-- Modules included in this library but not exported.
-- other-modules:
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
-- Other library packages from which modules are imported.
build-depends: base >=4.7 && <4.8,
ihaskell >= 0.5,
static-canvas >= 0.2,
text >= 1.2
-- Directories containing source files.
hs-source-dirs: src
-- Base language which the package is written in.
default-language: Haskell2010
ihaskell-display/ihaskell-static-canvas/src/IHaskell/Display/StaticCanvas.hs
0 → 100644
View file @
fcb5107c
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module
IHaskell.Display.StaticCanvas
(
Canvas
(
..
))
where
import
Data.Text.Lazy.Builder
(
toLazyText
)
import
Data.Text.Lazy
(
unpack
)
import
Data.Text
(
pack
,
Text
)
import
System.IO.Unsafe
import
Control.Concurrent.MVar
import
Graphics.Static
import
IHaskell.Display
{-# NOINLINE uniqueCounter #-}
uniqueCounter
::
MVar
Int
uniqueCounter
=
unsafePerformIO
$
newMVar
0
getUniqueName
::
IO
Text
getUniqueName
=
do
val
<-
takeMVar
uniqueCounter
let
val'
=
val
+
1
putMVar
uniqueCounter
val'
return
$
pack
$
"ihaskellStaticCanvasUniqueID"
++
show
val
data
Canvas
=
Canvas
{
width
::
Int
,
height
::
Int
,
canvas
::
CanvasFree
()
}
instance
IHaskellDisplay
Canvas
where
display
cnv
=
do
name
<-
getUniqueName
let
script
=
buildScript'
(
width
cnv
)
(
height
cnv
)
name
(
canvas
cnv
)
return
$
Display
[
html
$
unpack
$
toLazyText
script
]
src/IHaskell/Eval/Evaluate.hs
View file @
fcb5107c
...
@@ -78,7 +78,7 @@ data ErrorOccurred = Success | Failure deriving (Show, Eq)
...
@@ -78,7 +78,7 @@ data ErrorOccurred = Success | Failure deriving (Show, Eq)
-- | Enable debugging output
-- | Enable debugging output
debug
::
Bool
debug
::
Bool
debug
=
False
debug
=
False
-- | Set GHC's verbosity for debugging
-- | Set GHC's verbosity for debugging
ghcVerbosity
::
Maybe
Int
ghcVerbosity
::
Maybe
Int
...
@@ -193,8 +193,11 @@ initializeImports = do
...
@@ -193,8 +193,11 @@ initializeImports = do
importFmt
=
"import IHaskell.Display.%s"
importFmt
=
"import IHaskell.Display.%s"
dropFirstAndLast
::
[
a
]
->
[
a
]
dropFirstAndLast
=
reverse
.
drop
1
.
reverse
.
drop
1
toImportStmt
::
String
->
String
toImportStmt
::
String
->
String
toImportStmt
=
printf
importFmt
.
concat
.
map
capitalize
.
(
drop
1
)
.
split
"-"
toImportStmt
=
printf
importFmt
.
concat
.
map
capitalize
.
dropFirstAndLast
.
split
"-"
displayImports
=
map
toImportStmt
displayPackages
displayImports
=
map
toImportStmt
displayPackages
...
...
src/IHaskell/Eval/Util.hs
View file @
fcb5107c
...
@@ -318,8 +318,13 @@ cleanUpDuplicateInstances = modifySession $ \hscEnv ->
...
@@ -318,8 +318,13 @@ cleanUpDuplicateInstances = modifySession $ \hscEnv ->
where
where
instEq
::
ClsInst
->
ClsInst
->
Bool
instEq
::
ClsInst
->
ClsInst
->
Bool
instEq
ClsInst
{
is_tvs
=
tpl_tvs
,
is_tys
=
tpl_tys
}
ClsInst
{
is_tys
=
tpl_tys'
}
=
instEq
ClsInst
{
is_tvs
=
tpl_tvs
,
is_tys
=
tpl_tys
}
ClsInst
{
is_tys
=
tpl_tys'
}
=
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
-- Only support replacing instances on GHC 7.8 and up
let
tpl_tv_set
=
mkVarSet
tpl_tvs
let
tpl_tv_set
=
mkVarSet
tpl_tvs
in
isJust
$
tcMatchTys
tpl_tv_set
tpl_tys
tpl_tys'
in
isJust
$
tcMatchTys
tpl_tv_set
tpl_tys
tpl_tys'
#
else
False
#
endif
-- | Get the type of an expression and convert it to a string.
-- | Get the type of an expression and convert it to a string.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment