Coder Social home page Coder Social logo

Examples about haskell HOT 7 CLOSED

kubernetes-client avatar kubernetes-client commented on July 17, 2024
Examples

from haskell.

Comments (7)

cirquit avatar cirquit commented on July 17, 2024

So after setting up the environment #64 it seems like I can't get the basic functionality to start working with the library. It seems like any functionality from http-client is hidden and I can't access it the usual way.

Example:

> (manager, config) <- connectKubernetes
> (MimeResult response status) <- dispatchMime manager config $ CoreV1.listNamespace $ Accept MimeJSON
> responseStatus status
<interactive>:32:1: error:
    Variable not in scope:
      responseStatus
        :: http-client-0.5.14:Network.HTTP.Client.Types.Response
             bytestring-0.10.8.2:Data.ByteString.Lazy.Internal.ByteString
           -> t

Per this cabal FAQ it seems the proposed solution was to add http-client into the package.yaml, but it did not help at all.

Maybe it's some easy solution I'm missing because it's been some time since working with Haskell.

from haskell.

akshaymankar avatar akshaymankar commented on July 17, 2024

I have written couple of examples in #61. Hopefully we'll grow them soon, we can use this issue to track that.

It seems like any functionality from http-client is hidden and I can't access it the usual way.

Cabal treats all transitive dependencies as hidden packages, so you cannot import things from them. To import them, you'd have to add them as a direct dependencies of your package. In this case, add http-clientto package.yaml and import Network.HTTP.Client

from haskell.

cirquit avatar cirquit commented on July 17, 2024

Thank you for the examples, seems like I can get started with those. For the hidden package problem - this is exactly what I've done and it still is not possible for me to import the module:

> stack ghci
Main KubernetesWrapper> import Network.HTTP.Client.Types
<no location info>: error:
    Could not load module Network.HTTP.Client.Types
    it is a hidden module in the package http-client-0.5.14

I've already tried stack clean, deleting the project and setting it up again and specifying the version to http-client-0.5.14 in the package.yaml under dependencies.

EDIT: Ok, it seems I got it working, but I do not really understand why. The package.yaml where it did not work looked like this.

dependencies:
  - base >= 4.7 && < 5
  - http-client == 0.5.14
  # kubernetes stuff
  - kubernetes-client >= 0.1.0.1 && < 2
  - kubernetes-client-core >= 0.1.0.1 && < 2
  - connection >= 0.2.8 && < 3
  - containers
  - x509-validation
  - stm >= 2.5.0.0 && < 3
  # amqp stuff
  - amqp-worker >= 0.3.2 && < 0.4.0
  - text >= 1.2.3.1 && < 1.3.0.0
  - exceptions >= 0.10.3 && < 0.11.0
  - aeson >= 1.4.5.0 && < 1.5.0.0

library:
  source-dirs: src

And after adding the http-client as an additional dependency (what do the previous dependencies then mean?) to the library it worked:

library:
  source-dirs: src
  dependencies:
    - http-client == 0.5.14

Seems slightly counterintuitive, but at least it works for now.

from haskell.

fejta-bot avatar fejta-bot commented on July 17, 2024

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

from haskell.

fejta-bot avatar fejta-bot commented on July 17, 2024

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

from haskell.

fejta-bot avatar fejta-bot commented on July 17, 2024

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

from haskell.

k8s-ci-robot avatar k8s-ci-robot commented on July 17, 2024

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from haskell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.