ats-storable 0.1.0.4 → 0.1.0.5
raw patch · 4 files changed
+4/−411 lines, 4 filesdep −ats-storabledep −hspecdep ~basesetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies removed: ats-storable, hspec
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Setup.hs +2/−5
- ats-storable.cabal +2/−25
- cbits/ats-generic.c +0/−356
- test/Spec.hs +0/−25
Setup.hs view
@@ -1,5 +1,2 @@--- import Distribution.ATS-import Distribution.Simple--main = defaultMainWithHooks $ defaultUserHooks- -- atsUserHooks mempty -- [ atsPrelude [0,3,9] ]+import Distribution.Simple+main = defaultMain
ats-storable.cabal view
@@ -1,5 +1,5 @@ name: ats-storable-version: 0.1.0.4+version: 0.1.0.5 synopsis: Marshal ATS types into Haskell description: Facilities for sharing types between ATS and Haskell homepage: https://github.com//ats-generic#readme@@ -9,8 +9,7 @@ maintainer: vamchale@gmail.com copyright: Copyright: (c) 2018 Vanessa McHale category: ATS, Generics-build-type: Custom-extra-source-files: cbits/ats-generic.c+build-type: Simple extra-doc-files: README.md cabal-version: >=1.18 @@ -20,15 +19,7 @@ default: False } -custom-setup- setup-depends: base >= 4.7 && < 5, - -- ats-setup >= 0.1.0.2,- Cabal- library- -- c-sources: cbits/ats-generic.c- -- include-dirs: ats-deps/prelude/ATS2-Postiats-include-0.3.9/ccomp/runtime- -- , ats-deps/prelude/ATS2-Postiats-include-0.3.9 hs-source-dirs: src exposed-modules: Foreign.Storable.ATS build-depends: base >= 4.7 && < 5@@ -39,20 +30,6 @@ if impl(ghc >= 8.0) ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat ghc-options: -Wall--test-suite ats-generic-test- type: exitcode-stdio-1.0- hs-source-dirs: test- main-is: Spec.hs- build-depends: base- , ats-storable- , hspec- if flag(development)- ghc-options: -Werror- if impl(ghc >= 8.0)- ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat - ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall- default-language: Haskell2010 source-repository head type: darcs
− cbits/ats-generic.c
@@ -1,356 +0,0 @@-/*-**-** The C code is generated by [ATS/Postiats-0-3-9]-** The starting compilation time is: 2018-2-4: 17h:45m-**-*/--/*-** include runtime header files-*/-#ifndef _ATS_CCOMP_HEADER_NONE_-#include "pats_ccomp_config.h"-#include "pats_ccomp_basics.h"-#include "pats_ccomp_typedefs.h"-#include "pats_ccomp_instrset.h"-#include "pats_ccomp_memalloc.h"-#ifndef _ATS_CCOMP_EXCEPTION_NONE_-#include "pats_ccomp_memalloca.h"-#include "pats_ccomp_exception.h"-#endif // end of [_ATS_CCOMP_EXCEPTION_NONE_]-#endif /* _ATS_CCOMP_HEADER_NONE_ */---/*-** include prelude cats files-*/-#ifndef _ATS_CCOMP_PRELUDE_NONE_-//-#include "prelude/CATS/basics.cats"-#include "prelude/CATS/integer.cats"-#include "prelude/CATS/pointer.cats"-#include "prelude/CATS/integer_long.cats"-#include "prelude/CATS/integer_size.cats"-#include "prelude/CATS/integer_short.cats"-#include "prelude/CATS/bool.cats"-#include "prelude/CATS/char.cats"-#include "prelude/CATS/float.cats"-#include "prelude/CATS/integer_ptr.cats"-#include "prelude/CATS/integer_fixed.cats"-#include "prelude/CATS/memory.cats"-#include "prelude/CATS/string.cats"-#include "prelude/CATS/strptr.cats"-//-#include "prelude/CATS/fprintf.cats"-//-#include "prelude/CATS/filebas.cats"-//-#include "prelude/CATS/list.cats"-#include "prelude/CATS/option.cats"-#include "prelude/CATS/array.cats"-#include "prelude/CATS/arrayptr.cats"-#include "prelude/CATS/arrayref.cats"-#include "prelude/CATS/matrix.cats"-#include "prelude/CATS/matrixptr.cats"-//-#endif /* _ATS_CCOMP_PRELUDE_NONE_ */-/*-** for user-supplied prelude-*/-#ifdef _ATS_CCOMP_PRELUDE_USER_-//-#include _ATS_CCOMP_PRELUDE_USER_-//-#endif /* _ATS_CCOMP_PRELUDE_USER_ */-/*-** for user2-supplied prelude-*/-#ifdef _ATS_CCOMP_PRELUDE_USER2_-//-#include _ATS_CCOMP_PRELUDE_USER2_-//-#endif /* _ATS_CCOMP_PRELUDE_USER2_ */--/*-staload-prologues(beg)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/basics.dats: 1636(line=50, offs=1) -- 1675(line=50, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer.dats: 1596(line=49, offs=1) -- 1635(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/pointer.dats: 1533(line=44, offs=1) -- 1572(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer_long.dats: 1602(line=49, offs=1) -- 1641(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer_size.dats: 1597(line=49, offs=1) -- 1636(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer_short.dats: 1603(line=49, offs=1) -- 1642(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/char.dats: 1610(line=48, offs=1) -- 1649(line=48, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/float.dats: 1636(line=50, offs=1) -- 1675(line=50, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/string.dats: 1631(line=50, offs=1) -- 1670(line=50, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/strptr.dats: 1629(line=50, offs=1) -- 1668(line=50, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/strptr.dats: 1691(line=54, offs=1) -- 1738(line=54, offs=48)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer.dats: 1596(line=49, offs=1) -- 1635(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer_ptr.dats: 1601(line=49, offs=1) -- 1640(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer_fixed.dats: 1603(line=49, offs=1) -- 1642(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/memory.dats: 1410(line=38, offs=1) -- 1449(line=39, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/filebas.dats: 1607(line=49, offs=1) -- 1646(line=50, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/filebas.dats: 1669(line=54, offs=1) -- 1715(line=55, offs=39)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/integer.dats: 1596(line=49, offs=1) -- 1635(line=49, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/filebas.dats: 1738(line=59, offs=1) -- 1783(line=60, offs=38)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/stdio.sats: 1390(line=36, offs=1) -- 1437(line=39, offs=3)-*/--#include \-"libats/libc/CATS/stdio.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/stdio.sats: 1950(line=69, offs=1) -- 1999(line=71, offs=34)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/sys/types.sats: 1390(line=36, offs=1) -- 1441(line=39, offs=3)-*/--#include \-"libats/libc/CATS/sys/types.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/filebas.dats: 1865(line=66, offs=1) -- 1912(line=66, offs=48)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/sys/stat.sats: 1390(line=36, offs=1) -- 1440(line=39, offs=3)-*/--#include \-"libats/libc/CATS/sys/stat.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/sys/stat.sats: 1756(line=58, offs=1) -- 1805(line=60, offs=34)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/sys/types.sats: 1390(line=36, offs=1) -- 1441(line=39, offs=3)-*/--#include \-"libats/libc/CATS/sys/types.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/filebas.dats: 15937(line=927, offs=1) -- 15974(line=928, offs=30)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/stdio.sats: 1390(line=36, offs=1) -- 1437(line=39, offs=3)-*/--#include \-"libats/libc/CATS/stdio.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/stdio.sats: 1950(line=69, offs=1) -- 1999(line=71, offs=34)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/libats/libc/SATS/sys/types.sats: 1390(line=36, offs=1) -- 1441(line=39, offs=3)-*/--#include \-"libats/libc/CATS/sys/types.cats"-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/list.dats: 1529(line=44, offs=1) -- 1568(line=45, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/list.dats: 1569(line=46, offs=1) -- 1615(line=47, offs=39)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/unsafe.dats: 1532(line=44, offs=1) -- 1566(line=44, offs=35)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/list_vt.dats: 1538(line=44, offs=1) -- 1577(line=45, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/list_vt.dats: 1578(line=46, offs=1) -- 1624(line=47, offs=39)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/unsafe.dats: 1532(line=44, offs=1) -- 1566(line=44, offs=35)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/SHARE/list_vt_mergesort.dats: 1546(line=44, offs=1) -- 1585(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/SHARE/list_vt_quicksort.dats: 1546(line=44, offs=1) -- 1585(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/array.dats: 1528(line=44, offs=1) -- 1567(line=45, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/SHARE/array_bsearch.dats: 1531(line=44, offs=1) -- 1570(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/SHARE/array_quicksort.dats: 1531(line=44, offs=1) -- 1570(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/arrayptr.dats: 1532(line=44, offs=1) -- 1571(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/arrayref.dats: 1532(line=44, offs=1) -- 1571(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/matrix.dats: 1535(line=44, offs=1) -- 1574(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/matrixptr.dats: 1538(line=44, offs=1) -- 1577(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/matrixref.dats: 1538(line=44, offs=1) -- 1577(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/stream.dats: 1523(line=44, offs=1) -- 1562(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/stream_vt.dats: 1523(line=44, offs=1) -- 1562(line=44, offs=40)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/tostring.dats: 1528(line=44, offs=1) -- 1567(line=45, offs=32)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/unsafe.dats: 1532(line=44, offs=1) -- 1566(line=44, offs=35)-*/-/*-/home/vanessa/.atspkg/0.3.9/lib/ats2-postiats-0.3.9/prelude/DATS/checkast.dats: 1531(line=44, offs=1) -- 1570(line=45, offs=32)-*/-/*-staload-prologues(end)-*/-/*-typedefs-for-tyrecs-and-tysums(beg)-*/-typedef-ATSstruct {-atstkind_t0ype(atstype_int) atslab__first ;-atstkind_t0ype(atstype_int) atslab__second ;-} postiats_tyrec_0 ;-/*-typedefs-for-tyrecs-and-tysums(end)-*/-/*-dynconlst-declaration(beg)-*/-/*-dynconlst-declaration(end)-*/-/*-dyncstlst-declaration(beg)-*/-/*-dyncstlst-declaration(end)-*/-/*-dynvalist-implementation(beg)-*/-ATSdyncst_valimp(pass_boring_type, postiats_tyrec_0) ;-/*-dynvalist-implementation(end)-*/-/*-exnconlst-declaration(beg)-*/-#ifndef _ATS_CCOMP_EXCEPTION_NONE_-ATSextern()-atsvoid_t0ype-the_atsexncon_initize-(- atstype_exnconptr d2c, atstype_string exnmsg-) ;-#endif // end of [_ATS_CCOMP_EXCEPTION_NONE_]-/*-exnconlst-declaration(end)-*/-/*-extypelst-declaration(beg)-*/-/*-extypelst-declaration(end)-*/-/*-assumelst-declaration(beg)-*/-#ifndef _ATS_CCOMP_ASSUME_CHECK_NONE_-#endif // #ifndef(_ATS_CCOMP_ASSUME_CHECK_NONE_)-/*-assumelst-declaration(end)-*/-ATSstatmpdec(statmp0, postiats_tyrec_0) ;-/*-** for initialization(dynloading)-*/-ATSdynloadflag_minit(_057_home_057_vanessa_057_programming_057_haskell_057_done_057_hs_055_ats_057_ats_055_storable_057_ats_055_src_057_ats_055_generic_056_dats__dynloadflag) ;-ATSextern()-atsvoid_t0ype-_057_home_057_vanessa_057_programming_057_haskell_057_done_057_hs_055_ats_057_ats_055_storable_057_ats_055_src_057_ats_055_generic_056_dats__dynload()-{-ATSfunbody_beg()-ATSdynload(/*void*/)-ATSdynloadflag_sta(-_057_home_057_vanessa_057_programming_057_haskell_057_done_057_hs_055_ats_057_ats_055_storable_057_ats_055_src_057_ats_055_generic_056_dats__dynloadflag-) ;-ATSif(-ATSCKiseqz(-_057_home_057_vanessa_057_programming_057_haskell_057_done_057_hs_055_ats_057_ats_055_storable_057_ats_055_src_057_ats_055_generic_056_dats__dynloadflag-)-) ATSthen() {-ATSdynloadset(_057_home_057_vanessa_057_programming_057_haskell_057_done_057_hs_055_ats_057_ats_055_storable_057_ats_055_src_057_ats_055_generic_056_dats__dynloadflag) ;-/*-dynexnlst-initize(beg)-*/-/*-dynexnlst-initize(end)-*/-/* local */-/* in of [local] */-/*-emit_instr: loc0 = /home/vanessa/programming/haskell/done/hs-ats/ats-storable/ats-src/ats-generic.dats: 200(line=9, offs=39) -- 228(line=9, offs=67)-*/-ATSINSmove_fltrec_beg()-ATSINSstore_fltrec_ofs(statmp0, postiats_tyrec_0, atslab__first, ATSPMVi0nt(12)) ;-ATSINSstore_fltrec_ofs(statmp0, postiats_tyrec_0, atslab__second, ATSPMVi0nt(13)) ;-ATSINSmove_fltrec_end()-/*-emit_instr: loc0 = /home/vanessa/programming/haskell/done/hs-ats/ats-storable/ats-src/ats-generic.dats: 291(line=14, offs=11) -- 330(line=15, offs=21)-*/-ATSINSdyncst_valbind(pass_boring_type, statmp0) ;-/* end of [local] */-} /* ATSendif */-ATSfunbody_end()-ATSreturn_void(tmpret_void) ;-} /* end of [*_dynload] */--/* ****** ****** */--/* end-of-compilation-unit */
− test/Spec.hs
@@ -1,25 +0,0 @@-{-# LANGUAGE DeriveAnyClass #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE ForeignFunctionInterface #-}-{-# LANGUAGE IncoherentInstances #-}--import Foreign.C.Types-import Foreign.Ptr-import Foreign.Storable.ATS-import GHC.Generics-import Test.Hspec--data BoringType = BoringType CInt CInt- deriving (Show, Eq, Generic, ATSStorable)--foreign import ccall unsafe pass_boring_type :: Ptr BoringType---- are pointers functorial?? a monad??-passBoringType :: IO BoringType-passBoringType = peek pass_boring_type--main :: IO ()-main = hspec $- parallel $ describe "passBoringType" $- it "should so the right thing" $- passBoringType >>= (`shouldBe` (BoringType 12 13))