Git Product home page Git Product logo

cpuinfo's Introduction

cpuinfo CircleCI

Haskell Library for Checking CPU Information

cpuinfo's People

Contributors

traviswhitaker avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

cpuinfo's Issues

support for OS X

Hi, I need a module with physical cpus for both Linux and OS X, and I thought of adding it to cpuinfo, but I think the current API isn't going to work for anything other than linux. The reason is the CPU type has a million fields, many of them are linux-specific, and the useful functions like physicalCores require CPUs.

What I would do is change functions like physicalCores to have type IO Int. This is implemented as /usr/sbin/sysctl -n hw.physicalcpu on OS X, and by parsing /proc/cpuinfo on linux. If they all throw the same NotSupported exception, we can have a try which turns them into Maybe Int if you don't want to crash on an unsupported platform.

Personally I'd just get rid of the CPU type because I don't have a use for all those fields, but I guess it doesn't hurt to have it, as long as it's clear that it's Linux-specific. Even use CPP to make it not compile on non-linux instead of compile but crash at runtime, but I don't care much either way.

Would you be interested in a change like that? It would be basically a rewrite and incompatible API. Otherwise I can make my own package easily enough, but it's a bit of a shame to have two similar packages in hackage. You could also transfer ownership to me if you'd like.

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.