Roman: Awesome! I'm really glad that this is ready for use!
Andrew: I have a tool that's a step towards doing this. Instead of using
haskell suite, it uses ghci via hint to query module exports, and then uses
TH to reify them. This has the benefit of supporting everything that GHC
supports, whe
Hello!
I'm not sure if this is what you're asking for, as it doesn't fit that line
of code. 'LitT' is a data constructor not a type constructor. So instead
it'd be
reifyType (LitT ...) = ConE 'LitT ...
If this is what you're looking for, then 'lift' is what you want:
http://hackage.haskell.org
You might need to cabal update - I recently uploaded a new version to
hackage, because I realized the package was a bit out of date from the
github repo.
It works for me: https://gist.github.com/mgsloan/f9238b2272df43e53896
On Fri, Jul 12, 2013 at 5:49 AM, Jose A. Lopes wrote:
> Hello,
>
> I a
Yup, such a thing exists! I think it's a little bit obscure because for
some bizarre reason it isn't reexported by Language.Haskell.TH:
http://hackage.haskell.org/packages/archive/template-haskell/2.8.0.0/doc/html/Language-Haskell-TH-Syntax.html#v:addDependentFile
-Michael
On Tue, Jul 16, 2013
This portion of haskell-mode (haskell-interactive-mode-eval-pretty) is what
the UI for something like this could look like:
https://www.youtube.com/watch?v=pu9AGSOySlE
This isn't an answer to your question, though, because expanding subparts
of the output doesn't drive evaluation. It would be ve
Not that I really want to encourage such a "stringly typed" practice, but
it wouldn't really be that much of a stretch.
* Use haskell-src-exts[0] and haskell-src-meta[1] to make a quasiquoter
that can parse Haskell syntax
* Use syb[2] or some other generics to find VarE and ConE expressions. In
o
eted, clearing a set results in a value that is not
the same as "zero". I suppose that "clear" aught to be in a separate
class.
-Michael Sloan
On Wed, Apr 11, 2012 at 10:47 PM, 陈文龙 wrote:
>
> To get element in List,Map... in python's way.
>
>
>
>
&
stuff - a default
definition for lookup cannot be declared inside Indexable.
I prefer my class for this - partiality is just (Codomain t ~ Maybe a)
- but ekmett likely has his reasons!
-Michael Sloan
On Thu, Apr 12, 2012 at 1:22 AM, 陈文龙 wrote:
> The Indexable class is declared as
>
&
n the type
variables used in the selected function.
-Michael Sloan
On Fri, Apr 13, 2012 at 11:37 AM, Ismael Figueroa Palet
wrote:
> Hi all, I think this is the right place for the following questions and I
> thank beforehand for your answers :-)
>
>
> I'm experimenting with typ
e a bit of work (but could be very useful for other TH
quasiquoting stuff!).
You might also be interested in this:
http://hackage.haskell.org/package/zeroth-2009.6.23.3
Hope that helps!
-Michael Sloan
On Wed, Apr 18, 2012 at 9:49 AM, Ismael Figueroa Palet
wrote:
> I'm working on getting
Upper bounds are a bit of a catch-22 when it comes to library authors evolving
their APIs:
1) If library clients aren't encouraged to specify which version of the
exported API they target, then changing APIs can lead to opaque compile
errors (without any information about which API is intend
I agree that Haskell's design gives us a good leg up on the problem of
acquiring and comparing APIs. However, I don't think that this
manifest solution really buys us enough to justify the complexity.
There're also some specific, perhaps resolvable, but unsightly problems, which
I outline here:
ht
A good way to specify such refactorings is as a Haskell module. For example:
module PreludePre_7_6 where
import Prelude hiding ( catch )
Or, an example of avoiding the Eq / Show / Num debacle:
module PreludePre_7_4 (module Prelude, Num) where
import Prelude hiding ( Num )
import qualified P
Whoops, I messed up that first example:
module PreludePre_7_6 (module Prelude, catch) where
import Prelude
import qualified System.IO.Error as E
catch = E.catch
On Thu, Aug 30, 2012 at 12:16 PM, Michael Sloan wrote:
> A good way to specify such refactorings is as a Haskell module.
I've seen this asked before, and I think some languages support it (ML
maybe?). One way to do this is with view patterns:
g f C = [f C]
g f (getVN -> (v, n)) = f v : g f n
getVN v@(A _ n) = (v, n)
getVN v@(B _ n) = (v, n)
(I changed the recursive call to g - figured you meant passing along f)
Hello!
Perhaps package imports would do the trick?
http://haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#package-imports
Not exactly something you'd want to release in a module in a hackage
package, though.
-Michael
On Oct 4, 2012 7:07 AM, "Janek S." wrote:
> > so if it's wait
Hey!
I was doing similar things with my project "haskellion" ( which I know
you've seen because you're the only one that's commented on it -
http://www.youtube.com/watch?v=gn_ZZiXVlNY&feature=plcp ). I'm not
planning on getting back to work on it anytime soon (there's way too
much Haskell stuff I
I've never understood this restriction. Template Haskell cannot
convert your code to something entirely different, only generate code
at splice points. It seems to me like Safe Haskell should already
have the necessary mechanisms for Safe Template Haskell to be
implemented.
The Safe Haskell docs
It happened somewhere between 2.6 and 2.7:
http://hackage.haskell.org/packages/archive/lens/2.6.1/doc/html/Control-Lens-Internal.html
http://hackage.haskell.org/packages/archive/lens/2.7.0.1/doc/html/Control-Lens-Internal.html
The strange thing is that the only internal dependency of 2.7.0.1,
Con
ely
> Trustworthy where needed.
>
> Please let me know if I missed flagged anything you need flagged, or
> mis-flagged anything you think shouldn't be. ;)
>
>
> On Mon, Oct 29, 2012 at 5:42 PM, Michael Sloan wrote:
>>
>> It happened somewhere between 2.6 and 2
I don't think that there is a particular reason for not supporting
quasi-quotes in where clauses.. It should be added!
The reason for /splices/ to not be supported in here statements is that
they are run during type checking. That way calls to "reify" can access
type information for things befor
Hello!
Try doing this first:
loadModules ["My.Module"]
You may also need to set the "searchPath" - it defaults to the current
director. Another good function to know about is "setTopLevelModules",
which is just like using ":load" in ghci - it imports everything in the
module, including its im
ageImports]]
>
> nor
>
> {-# LANGUAGE PackageImports #-}
>
> helps.
>
> have fun
> martin
>
>
> On 21.12.2012 00:55, Michael Sloan wrote:
>
>> Hello!
>>
>> Try doing this first:
>>
>>loadModules ["My.Module"]
&g
ly on a computer
with GHC.
If this module is in a package, then there's definitely no way to give it
an extra import (it's already compiled).
Hope that helps!
-Michael
On Thu, Dec 20, 2012 at 5:02 PM, Martin Hilbig wrote:
> On 21.12.2012 01:23, Michael Sloan wrote:
>
>> Ye
will fail -
because it doesn't know that it needs to load your "Prelude.hs" instead of
the ordinary one. (Seeing ghci fail in the presence of a "Prelude.hs" is
the only reason I thought that this might work - and it did!)
Hope that's helpful!
-Michael
On Thu, Dec
I also like this idea a lot! Here're a couple more benefits:
1) This makes it possible to generate documentation from TH - quite handy
for things like lens generation / Yesod-like DSLs.
2) The annotation can aid automatically determining how an API has changed.
I have a WIP tool[1] that tries to
I'm no lens authority by any means, but indeed, it looks like something
like Cursor / Axis could be done with the lens zipper.
https://github.com/snoyberg/xml/blob/0367af336e86d723bd9c9fbb49db0f86d1f989e6/xml-enumerator/Text/XML/Cursor/Generic.hs#L38
This cursor datatype is very much like the (:>
Err: That first link into Zipper.hs should instead be:
https://github.com/ekmett/lens/blob/f8dfe3fd444648f61b8594cd672c25e70c8a30ff/src/Control/Lens/Internal/Zipper.hs#L66
On Sun, Feb 10, 2013 at 9:40 PM, Michael Sloan wrote:
> I'm no lens authority by any means, but indeed, it lo
those.
-Michael
On Sun, Feb 10, 2013 at 9:41 PM, Michael Sloan wrote:
> Err: That first link into Zipper.hs should instead be:
>
>
> https://github.com/ekmett/lens/blob/f8dfe3fd444648f61b8594cd672c25e70c8a30ff/src/Control/Lens/Internal/Zipper.hs#L66
>
>
> On Sun, Feb 10, 2013 at
Dependency breakage is certainly an unavoidable problem. However, I think
Haskell is also in a much better position for having a technical solution
to the frustration of breakages.
Barring issues with changing datatypes / class instances, we can already
express many of the API changes you'd want
30 matches
Mail list logo